[egenix-users] cmp() function

Dirk Holtwick holtwick at spirito.de
Mon Dec 19 16:00:21 CET 2005


M.-A. Lemburg schrieb:
> No. In fact, the cmp() function was named deliberately after
> the builtin one. Falling back to the system one would only
> hide a programming error.

Well, finding such a programming error is hard. I didn't expect DateTime
to override the cmp() function and was quite irritated when I tried to
implement an own sorting algorithm. Now that I know it, I can live with
this function ;-)

> In summary: You should never do "from mx.DateTime import *" -
> that's bad style :-)
> 
> I tend to always write:
> 
> from mx import DateTime
> ...
> d = DateTime.now()
> 
> Makes reading the code a lot easier too, esp. if you regularly
> work with or on large frameworks

Okay, looks nicer and is more expressive. I agree. But I like the "bad
style" too and as far as I know it is still allowed ;-)

Bye, Dirk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: holtwick.vcf
Type: text/x-vcard
Size: 304 bytes
Desc: not available
Url : /mailman-archives/egenix-users/attachments/20051219/5384a20e/holtwick-0138.vcf


More information about the egenix-users mailing list