PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 654 - __repr__ of enums should be more Pythonic
: __repr__ of enums should be more Pythonic
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: Shiboken
: HEAD
: All All
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-01-31 12:34 EET by Farsmo
Modified: 2011-05-26 17:03 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Farsmo 2011-01-31 12:34:42 EET
The patch for bug 593 didn't fix the __repr__ of enums. The most important
thing is that we want this __repr__ to be executable, while maintaining
readability.

<enum-item BrushStyle.SolidPattern (1)>
  should be
Qt.BrushStyle.SolidPattern

<enum-item BrushStyle.#out of bounds# (42)>
  should be
Qt.BrushStyle(42)

We have to pay attention to where the enum belongs:
<enum-item Type.Move (13)>
  should be
QEvent.Type.Move

which is also a lot more useful for the user.
Comment 1 Matti Airas 2011-02-01 06:45:03 EET
Thanks for the bug - prioritizing P4 (it's a rather minor issue and can wait
until after 1.0).

Who's the "we" in "we want", by the way?
Comment 2 Farsmo 2011-02-01 14:19:04 EET
Good question :-) I think it's the "author's we" because it's somewhat
indefinite.

It also hints at the previous discussion on whether __repr__ should be
executable, and I don't think anybody really disagreed.
Comment 3 renato filho 2011-05-03 01:14:02 EEST
fixed on shiboken commit:

commit d5794d3402e9b68d358b382c53f17ebbd08ca844
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Mon May 2 17:43:45 2011 -0300
Comment 4 renato filho 2011-05-26 17:03:53 EEST
PySide release 1.0.3