[PyQt] PyQt4.Qtcore defines 'hex'

Chris Withers chris at simplistix.co.uk
Wed Jan 7 10:33:00 GMT 2009


Giovanni Bajo wrote:
> 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.

You rather miss my point.

I don't ever use star imports anyway.

However, like most people, I learn by example, and when the examples 
contain exclusively start imports, they are much less helpful than they 
could be.

It's a shame PEP8 doesn't make a pronouncement on this. PEP 328 is 
pretty clear though...

> This has been discussed thousands of times and it starts getting
> annoying. 

Yes, it is annoying that all the example code continues to be in a form 
that confuses users trying to learn PyQt.

> 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.

What you and/or your customers do in the privacy of your own homes and 
offices is none of my concern ;-)

> 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.

Because it looks butt ugly for no reason.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the PyQt mailing list