[PyQt] Symbol naming system for PyQt under Python 3

Giovanni Bajo rasky at develer.com
Sun Dec 14 10:21:24 GMT 2008


On sab, 2008-12-13 at 00:49 +0100, David Boddie wrote:
> On Fri Dec 12 22:57:22 GMT 2008, Paul A. Giannaros wrote:
> 
> > Way out, I'm afraid. ~60% of QtCore symbols start with a "Q", and a
> > further ~21% start with a "q". That still leaves around 32 symbols
> > (16%) once you weed out __doc__ etc. Some have ridiculously common
> > names ("center", "flush", "bin"), and some conflict with basic Python
> > builtins ("hex" and "oct").
> 
> I hate the way hex pollutes the namespace. I'd really like those
> functions to be put away somewhere, like the Qt namespace for instance,
> though maybe it's not so great an impact for others as it is for me.
> 
> > QtGui is much better but still has a "Display" class.
> 
> I believe that this class is of limited use from within Python, but maybe
> it's just another case where a class should have been put in a namespace.

I'd be more than happy if PyQt4 defined an automatic __all__ list so
that those symbols simply don't get imported with star-imports. Then, if
one wants to access them, it has to use the other syntax (QtCore.hex).
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com




More information about the PyQt mailing list