[PyKDE] Auto-connecting Slots
rasky at develer.com
Sun Jan 29 16:58:05 GMT 2006
Gerard Vermeulen <gerard.vermeulen at grenoble.cnrs.fr> wrote:
>>> I understand that you like to take an unrecommended shortcut and
>>> pollute the global namespace (Q-, q-prefix or not), but it is no
>>> reason to make life harder for people who don't.
>> The Q prefix *is* a namespace. It's the way namespaces have always
>> worked way before we were using languages with explicit syntax for
>> namespaces, and the way it works in C++ for Qt. Then, if you want to
>> double your namespace by prefixing an unneeded QtCore in front of
>> it, and making your source code harder and slower to read, that's
>> your choice. The fact that in Python modules are namespaces doesn't
>> mean that one has to blindly use them as namespaces even when not
>> necessary. Again, I have *never* seen Python code using PyOpenGL
>> with the module as a namespace (GL.glBegin), so I just can't see why
>> it should be any different for Qt.
> from import PyQt4.QtCore import *
> hex and oct from QtCore are in the global namespace hiding two Python
> builtins. Nobody ever complained. Why single out the rather harmless
> There are more than 20 names without a Q or q prefix in QtCore (TT's
> decision). Shouldn't they all get a prefix? I don't think so.
Nobody ever complained because PyQt4 is pretty preliminar, it hasn't yet seen a
single public release. I don't have a recent PyQt4 snapshot around, can you
post a list of those names? Some could be skipped when using the star import
(using __all__). It pretty much depends on what they are. hex() and oct() looks
like another serious problem that needs a solution, to me.
More information about the PyQt