Skip to content

Issue with explicit_end set to False having no impact on small dump #379

@daniel-o-jones

Description

@daniel-o-jones

The following code leads to unexpected results
import yaml

print(yaml.dump(False, explicit_end=False))
print(yaml.dump(False, explicit_end=True))

Changing explicit_end results in no difference in output, with both printing three full stops and a new line after False.

print(yaml.dump({'key': False}, explicit_end=False))
print(yaml.dump({'key': False}, explicit_end=True))

Here changing explicit_end does result in a difference in output, with the former not printing the three full stops and newline.

Is this the desired behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions