-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Implement packaging.database.*Distribution.__str__ #57375
Comments
In code working with instances of packaging.database.Distribution, it’s bothersome to have to use '%r %s' % (dist.name, dist.version) all the time. It is also not good-looking in 2.x, where we get u'name'. I think it would be best to implement a __str__ method on the class and just use %s everywhere, for example in pysetup list and pysetup search. More sophisticated clients that want to display projects in a GUI can still access dist.name, dist.version and other attributes. I’ve insisted on using %r for project names and paths to avoid ambiguities with trailing spaces and such hard-to-catch things. For logging output, we have to pass pure strings, but for direct console printing we could use ANSI escape sequences to display projects’ names in bold for example. |
New changeset ff44594dd3c0 by Guillaume Pratte in branch 'default': |
64b0bf5e0596 reverted the changes to d2.depgraph; more tests need to be added first to make sure the new output is still valid DOT. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: