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

Format many-itemed tuples and unions consistently and more clearly #3893

Merged
merged 2 commits into from Aug 31, 2017

Conversation

Projects
None yet
2 participants
@OddBloke
Contributor

OddBloke commented Aug 30, 2017

When the string representation of a tuple or union is too long to display, a shorter representation is used. This moves from two different representations to <tuple: N items> and <union: N items>, and consistently does not quote them.

This also includes a refactoring of the quoting logic in to a separate method, which enables the quoting of star arguments consistently with other types.

OddBloke added some commits Aug 30, 2017

Refactor quoting of type strings to a separate method
This allows callers of .bare_format (who need to perform post-processing
before wrapping a type in quotes) to more easily match the quoting
patterns used by other callers.
Format many-itemed tuples and unions consistently and more clearly
When the string representation of a tuple or union is too long to
display, a shorter representation is used.  This moves from two
different representations to `<tuple: N items>` and
`<union: N items>`, and consistently does not quote them.
@OddBloke

This comment has been minimized.

Show comment
Hide comment
@OddBloke

OddBloke Aug 30, 2017

Contributor

This comes out of the conversation @ilevkivskyi and I had in #3873 (the relevant comments start here: #3873 (comment)).

Contributor

OddBloke commented Aug 30, 2017

This comes out of the conversation @ilevkivskyi and I had in #3873 (the relevant comments start here: #3873 (comment)).

@ilevkivskyi ilevkivskyi self-assigned this Aug 30, 2017

@ilevkivskyi

Thanks! This looks right. It is consistent with uses of <...> for absent/cropped output in other situations.

If there are no objections, then I will merge this soon.

@ilevkivskyi ilevkivskyi merged commit 20b891c into python:master Aug 31, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment