[PyKDE] converting enum types

Eron Lloyd eronlloyd at gmail.com
Thu Jun 8 22:18:08 BST 2006


On 6/8/06, Patrick Stinson <patrickkidd.lists at gmail.com> wrote:
> On 6/8/06, Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> > On Thursday 08 June 2006 2:55 pm, Patrick Stinson wrote:
> > > It seems like everywhere that there is an enum value returned from a
> > > function, like QInputEvent.modifiers(), you get a class defined by
> > > pyqt. What is the idea behind returning an object of this type instead
> > > of an int,
> >
> > Because enums aren't ints, they are distinct types.
>
> funny what you forget when you forsake the rest of the world for a
> life in python...

Indeed. However, let's hope Python gets first class enums of its own
soon: http://www.python.org/dev/peps/pep-0354/

Eron




More information about the PyQt mailing list