[PyKDE] QtCore.Qt and QtGui.Qt

Phil Thompson phil at riverbankcomputing.co.uk
Thu Mar 2 11:37:52 GMT 2006


On Thursday 02 March 2006 11:09 am, Giovanni Bajo wrote:
> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> > Up until recently I had planned (and partially implemented) the idea that
>
> a
>
> > namespace would only appear once and that any objects implemented in
> > other modules would be placed in it. In other words...
> >
> > from PyQt4 import QtCore
> > dir(QtCore)
> > from PyQt4 import QtGui
> > dir(QtCore)
> >
> > ...would give different output for each dir(). This was a pain to
>
> implement
>
> > and (I thought) more confusing for the user - I'm not saying which of
>
> those
>
> > carried the most weight.
>
> Are you saying that this:
>
> ---------------------------
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
>
> dir(Qt)
> ---------------------------
>
> won't show the full Qt namespace, thus making PyQt4 unusable without the
> annoying QtCore/QtGui prefix in front of everything?

Yes - I hadn't considered that - mainly because I don't adopt such a poor 
programming practice ;) Seriously, I don't have much sympathy for people 
using a feature that makes it easy to shoot yourself in the foot, and which 
is slated for removal in a future version of Python.

That said I can see lots of bug reports from lazy programmers, and I 
definitely want to avoid that.

Phil




More information about the PyQt mailing list