Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with aliases and deep = True #7

Closed
wants to merge 1 commit into from

Conversation

dustyrockpyle
Copy link

In BaseLoader.construct_object constructed_objects were being returned without checking if they'd been generated with deep=True.

Test:

>>> import yaml
>>> def test(loader, node):
>>>     return loader.construct_sequence(node, deep=True)
>>> yaml.add_constructor('!test', test)
>>> print(yaml.load("""
- &a [anchored]
- !test [*a]
"""))

Expected output: [['anchored'], [['anchored']]]

Output before: [['anchored'], [[]]]

…h deep=True.

>>> import yaml
>>> def test(loader, node):
>>>     return loader.construct_sequence(node, deep=True)
>>> yaml.add_constructor('!test', test)
>>> print(yaml.load("""
- &a [anchored]
- !test [*a]
""")

Expected output: [['anchored'], [['anchored']]]

Output before: [['anchored'], [[]]]
@ingydotnet ingydotnet closed this Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants