KEMBAR78
Format many-itemed tuples and unions consistently and more clearly by OddBloke · Pull Request #3893 · python/mypy · GitHub
Skip to content

Conversation

OddBloke
Copy link
Contributor

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.

Daniel Watkins added 2 commits August 30, 2017 16:50
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.
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
Copy link
Contributor Author

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
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
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