The REALLY bad thing about Python lists ..

Glyph Lefkowitz glyph at twistedmatrix.com
Tue May 16 13:16:30 EDT 2000


"Tim Peters" <tim_one at email.msn.com> writes:

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

The foibles of standards commitees will never cease to amuse me.
Thank you for this little tidbit.

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

Perl doesn't define it, at least in 5.005.  Now I can be a hypocrite
and trumpet python's mathematical superiority <0.5 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).

I just think it's sad that every piece of software that wants to
function in any reasonably cross-platform manner eventually becomes an
#ifdef'd mess.  *sigh*.  I suppose that's C for you, and it shouldn't
strike me as bad, but still...

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

Do you actually have a basis for that statistic?  Considering that
non-trivial parts of Red Hat Linux are actually written in Python,
Blender is scriptable in python (and I use many of those utilities on
my Debian system too)... pretty much everyone who uses Linux uses
Python, whereas I've seen little evidence of Python used in
widely-distributed Windows applications.  (Also, remembering that
TurboLinux, a RedHat derivative, is now the #1 OS in Japan...)

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

in-ten-years-we'll-all-be-running-EROS-2-on-sparc-one-billions-anyway-ly y'rs, 

-- 
                  __________________________________________
                 |    ______      __   __  _____  _     _   |
                 |   |  ____ |      \_/   |_____] |_____|   |
                 |   |_____| |_____  |    |       |     |   |
                 |   @ t w i s t e d m a t r i x  . c o m   |
                 |   http://www.twistedmatrix.com/~glyph/   |
                 `__________________________________________'




More information about the Python-list mailing list