Skip to content

Include default value in Choice template repr - #201

Open
Sanjays2402 wants to merge 1 commit into
beetbox:mainfrom
Sanjays2402:fix/choice-repr-default
Open

Include default value in Choice template repr#201
Sanjays2402 wants to merge 1 commit into
beetbox:mainfrom
Sanjays2402:fix/choice-repr-default

Conversation

@Sanjays2402

Copy link
Copy Markdown

Closes #127

Choice.__repr__ only rendered the choices, so Choice([1, 2], 2) and Choice([1, 2]) printed identically. It now appends the default when one is set, matching how String, OneOf and Filename already build their reprs.

Choice.__repr__ only rendered the choices, so a template created with
a default printed identically to one without it. Every other template
that accepts a default (String, OneOf, Filename) appends it to the
repr; Choice now does the same.
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

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.

templates.Choice.__repr__ should include default value

1 participant