This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Implement packaging.database.*Distribution.__str__
Type: Stage: resolved
Components: Distutils2 Versions: Python 3.3, 3rd party
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, python-dev, tarek
Priority: normal Keywords:

Created on 2011-10-13 15:52 by eric.araujo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg145463 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-13 15:52
In code working with instances of packaging.database.Distribution, it’s bothersome to have to use '%r %s' % (, 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.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.
msg160800 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-16 05:07
New changeset ff44594dd3c0 by Guillaume Pratte in branch 'default':
#13166: Implement __str__ on Distribution and EggInfoDistribution, use for pysetup list, pysetup graph and installation log
msg160896 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-16 17:51
64b0bf5e0596 reverted the changes to d2.depgraph; more tests need to be added first to make sure the new output is still valid DOT.
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57375
2014-03-13 00:42:16eric.araujosetstatus: open -> closed
resolution: out of date
stage: resolved
2012-05-16 17:51:55eric.araujosetassignee: tarek -> eric.araujo
messages: + msg160896
title: Implement packaging.database.Distribution.__str__ -> Implement packaging.database.*Distribution.__str__
2012-05-16 05:07:27python-devsetnosy: + python-dev
messages: + msg160800
2011-10-13 15:52:10eric.araujocreate