[PyQt] PyQt4.Qtcore defines 'hex'

Giovanni Bajo rasky at develer.com
Wed Jan 7 10:06:09 GMT 2009

On mer, 2009-01-07 at 09:26 +0000, Chris Withers wrote:
> Phil Thompson wrote:
> > On Tue, 06 Jan 2009 14:19:50 -0500, Neal Becker <ndbecker2 at gmail.com>
> > wrote:
> >> A bit nasty, since I see (and follow) lots of examples that say:
> >> from PyQt4.QtCore import *
> >>
> >> This redefines the builtin hex.
> > 
> > Check the Roadmap.
> Appending a _ just to make an unpleasant style of programming work seems 
> like a pretty silly idea.
> I, along with everyone else who's tryng to learn a new python package, 
> absolutely *hate* "from x import *" as it makes it much more difficult 
> figure out where something is coming from.

So don't use it.

This has been discussed thousands of times and it starts getting
annoying. There are many people (including myself and all our customers)
that simply love using star-imports with PyQt, since the leading Q* on
most symbols is already a clear enough indication of where the symbol is
coming from.

Appending the underscore to those symbols is a perfect fix IMO. I don't
see why people that don't use star-imports in the first place should
care about it at all.
Giovanni Bajo
Develer S.r.l.

More information about the PyQt mailing list