python gripes survey

John Roth newsgroups at jhrothjr.com
Mon Aug 25 02:31:39 CEST 2003


"Ryan Lowe" <ryanlowe0 at msn.com> wrote in message
news:ex42b.177723$_R5.67051940 at news4.srv.hcvlny.cv.net...
> "Dave Brueck" <dave at pythonapocrypha.com> wrote in message
> news:mailman.1061701097.12913.python-list at python.org...
> > Here's a short list of my anti-gripes - features that I like but some
> people complain about;
> > features that, if removed or changed too much, would make me like Python
> > less:
> >
> > - no assignment in if/while
> > - whitespace significant to both programmer and the language
> > - {} + {} not allowed ;-)
> > - private variables are a language-encouraged convention instead of an
> attempt
> > to babysit the programmer
> > - no macros
> > - no end-block tag required
> > - list comprehensions
> > - a "self" parameter is passed to all class methods, and by convention
we
> all
> > call it "self"
> > - tendency to prefer keywords over special characters
> > - thread-safe operations on fundamental objects (e.g. two threads doing
> > somedict['foo'] = x at the same time won't cause Python to crash or
> corrupot
> > somdict)
> > - list.sort() doesn't return the sorted list
> >
> > There are more, but this list is just off the top of my head. :)
> > -Dave
>
>
> id agree with most of those too. i hadnt really thought about the sort()
> function, but that does seem a little inconsistent with other methods
which
> do return a value. im sure there is a good reason for this (speed?).

It's because <list>.sort modifies the list in place. All of the list
functions that do this return None instead of the modified list.
The reason is to baby-sit the programmer: Guido thought that
if these methods returned the list, people would think that the
original, unmodified list still existed soemwhere.

As far as I'm concerned, it's a wart. Ruby (IMO) deals with this
issue better.

John Roth
>
>
>
>






More information about the Python-list mailing list