The REALLY bad thing about Python lists ..

Tim Peters tim_one at email.msn.com
Mon May 15 23:32:38 EDT 2000


[Glyph Lefkowitz]
> ...
> If a platform doesn't adhere to a standard or does something in a
> really brain-damaged way, it should be fixed on that platform.  I
> had this brought to my attention earlier today when someone on IRC
> was commenting that the % operator in perl and python carries the
> symantics from the C library of the platform in question, and
> sometimes that's wrong (off-by-one errors when it was being treated
> as 'remainder' rather than 'modulus' in negative numbers).

ISO/ANSI C doesn't fully define what happens when (roughly) integer division
or % are handed negative numbers.

Python does fully define it (& forces the issue regardless of what the
platform C does).

Don't remember what Perl does.  And don't care <wink>.

Python is generally *willing* to worm around platform bugs (look at all the
#ifdef'ed workarounds in the source!), but sometimes it's just more work
than anyone will volunteer.  For example, making os.system() work
predictably under Win95 (where the MS system() is broken in several ways).

See Starship for Vladimir Marangozov's PyMalloc, which may well become
Python's workaround for crappy platform mallocs one day; in 1.6, he's laying
a lot of the groundwork to make this possible.

As to the remarks about whether it was worth the time to port Python to
Windows, note that Windows is Python's most heavily used platform now -- I
personally doubt Python would have survived if it only had its Mac and Unix
base since '91.

"software-sucks"-exempts-no-philosophy-ly y'rs  - tim






More information about the Python-list mailing list