Skip to content
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

Closed
merwok opened this issue Oct 13, 2011 · 3 comments
Closed

Implement packaging.database.*Distribution.__str__ #57375

merwok opened this issue Oct 13, 2011 · 3 comments
Assignees

Comments

@merwok
Copy link
Member

merwok commented Oct 13, 2011

BPO 13166
Nosy @tarekziade, @merwok

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:

assignee = 'https://github.com/merwok'
closed_at = <Date 2014-03-13.00:42:16.626>
created_at = <Date 2011-10-13.15:52:10.839>
labels = []
title = 'Implement packaging.database.*Distribution.__str__'
updated_at = <Date 2014-03-13.00:42:16.626>
user = 'https://github.com/merwok'

bugs.python.org fields:

activity = <Date 2014-03-13.00:42:16.626>
actor = 'eric.araujo'
assignee = 'eric.araujo'
closed = True
closed_date = <Date 2014-03-13.00:42:16.626>
closer = 'eric.araujo'
components = ['Distutils2']
creation = <Date 2011-10-13.15:52:10.839>
creator = 'eric.araujo'
dependencies = []
files = []
hgrepos = []
issue_num = 13166
keywords = []
message_count = 3.0
messages = ['145463', '160800', '160896']
nosy_count = 4.0
nosy_names = ['tarek', 'eric.araujo', 'alexis', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue13166'
versions = ['3rd party', 'Python 3.3']

@merwok
Copy link
Member Author

merwok commented Oct 13, 2011

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.

@python-dev
Copy link
Mannequin

python-dev mannequin commented May 16, 2012

New changeset ff44594dd3c0 by Guillaume Pratte in branch 'default':
bpo-13166: Implement __str__ on Distribution and EggInfoDistribution, use for pysetup list, pysetup graph and installation log
http://hg.python.org/distutils2/rev/ff44594dd3c0

@merwok
Copy link
Member Author

merwok commented May 16, 2012

64b0bf5e0596 reverted the changes to d2.depgraph; more tests need to be added first to make sure the new output is still valid DOT.

@merwok merwok changed the title Implement packaging.database.Distribution.__str__ Implement packaging.database.*Distribution.__str__ May 16, 2012
@merwok merwok assigned merwok and unassigned tarekziade May 16, 2012
@merwok merwok closed this as completed Mar 13, 2014
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
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

No branches or pull requests

1 participant