Phil Thompson wrote:
On Tue, 06 Jan 2009 14:19:50 -0500, Neal Becker <[email protected]>
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.

I did raise this with David when this very issue tripped me and a number of other people up at the PyConUK tutorial last year.

If this were done sanely, you'd likely have:

from PyQt4.QtCore import hex

...somewhere, which, if it's causing problems, can easilly be changed to:

from PyQt4.QtCore import hex as qt_hex

Or, if you don't want do have a load of import statements, you can use the style that xlrd seems to prefer:

from PyQt4 import QtCore
...
QtCore.hex(...)

Either way, you end up knowing where stuff if coming from...

cheers,

Chris (who's still putting off using PyQt as he's dreading fighting his way through a load of *'s)

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to