[issue34443] enum repr should use __qualname__

2019-07-18 Thread Ethan Furman
Ethan Furman added the comment: New changeset 323842c2792a81e87917790506ec3457832c84b3 by Ethan Furman (Walter Dörwald) in branch 'master': bpo-34443: Use __qualname__ instead of __name__ in enum exception messages. (GH-14809)

[issue34443] enum repr should use __qualname__

2019-07-17 Thread Walter Dörwald
Change by Walter Dörwald : -- pull_requests: +14603 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/14809 ___ Python tracker ___

[issue34443] enum repr should use __qualname__

2019-07-16 Thread Ethan Furman
Ethan Furman added the comment: If someone would like to make a PR for using __qualname__ in error messages that would be great. :) -- stage: test needed -> needs patch ___ Python tracker

[issue34443] enum repr should use __qualname__

2019-07-16 Thread Ethan Furman
Ethan Furman added the comment: Both are good suggestions. The first should definitely happen. I'll investigate the second. -- resolution: rejected -> stage: resolved -> test needed status: closed -> open ___ Python tracker

[issue34443] enum repr should use __qualname__

2019-07-16 Thread Walter Dörwald
Walter Dörwald added the comment: Can we at least get the __qualname__ in exception messages? Currently enum.Enum.__new__() and enum.Enum._missing_() use: raise ValueError("%r is not a valid %s" % (value, cls.__name__)) IMHO this should be: raise ValueError("%r is not a valid %s" %

[issue34443] enum repr should use __qualname__

2019-07-15 Thread Ethan Furman
Change by Ethan Furman : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman
Ethan Furman added the comment: Okay, I might be changing my mind. In most cases I suspect the difference would be minimal, but when it isn't, it really isn't. Take this example from a pydoc test: class Color(enum.Enum) | Color(value, names=None, *, module=None, qualname=None,

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Ethan Furman
Ethan Furman added the comment: Serhiy said: --- > I think using more longer name in repr and/or str for *instances* of > enum classes is not good idea. They are already verbose, and this > will make them more verbose. I'm okay with verbose reprs, as debugging is the primary feature

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think using more longer name in repr and/or str for *instances* of enum classes is not good idea. They are already verbose, and this will make them more verbose. Actually in some cases when enum instances are exposed as module globals, I would want to

[issue34443] enum repr should use __qualname__

2018-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Serhiy, why should __qualname__ always be used together with __module__? Because what is the purpose of using __qualname__? -- ___ Python tracker

[issue34443] enum repr should use __qualname__

2018-08-31 Thread orlnub123
orlnub123 added the comment: After some thinking I've come to the conclusion that making the __str__s use the fully qualified name was a bad idea. I've closed my PR. -- ___ Python tracker

[issue34443] enum repr should use __qualname__

2018-08-30 Thread orlnub123
orlnub123 added the comment: I've created a separate PR that also changes the __str__s. -- nosy: +orlnub123 ___ Python tracker ___

[issue34443] enum repr should use __qualname__

2018-08-30 Thread orlnub123
Change by orlnub123 : -- pull_requests: +8481 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34443] enum repr should use __qualname__

2018-08-29 Thread Danish Prakash
Danish Prakash added the comment: Serhiy, why should __qualname__ always be used together with __module__? I can't seem to find a valid reason, I've been through the pep. -- nosy: +prakashdanish ___ Python tracker

[issue34443] enum repr should use __qualname__

2018-08-29 Thread Danish Prakash
Change by Danish Prakash : -- keywords: +patch pull_requests: +8462 stage: -> patch review ___ Python tracker ___ ___

[issue34443] enum repr should use __qualname__

2018-08-25 Thread Michał Radwański
Michał Radwański added the comment: Serhiy, would it be ok to put '__module__' + '.' + __qualname__ here? -- nosy: +enedil ___ Python tracker ___

[issue34443] enum repr should use __qualname__

2018-08-21 Thread underscore_asterisk
underscore_asterisk added the comment: Hi, I would like to work on this issue. I can submit a PR by tomorrow (or maybe even later today). -- nosy: +underscore_asterisk ___ Python tracker

[issue34443] enum repr should use __qualname__

2018-08-20 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34443] enum repr should use __qualname__

2018-08-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __qualname__ should be used only together with __module__. I agree that the repr of enum should be more consistent with the repr of class. -- nosy: +barry, eli.bendersky, ethan.furman, serhiy.storchaka versions: +Python 3.8

[issue34443] enum repr should use __qualname__

2018-08-20 Thread Walter Dörwald
Change by Walter Dörwald : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34443] enum repr should use __qualname__

2018-08-20 Thread Walter Dörwald
New submission from Walter Dörwald : The __repr__ output of an enum class should use __qualname__ instead of __name__. The following example shows the problem: import enum class X: class I: pass class Y: class I(enum.Enum): pass print(X.I) print(Y.I) This prints: I