Re: python gripes survey

Discussion in 'Python' started by Ryan Lowe, Aug 24, 2003.

  1. Ryan Lowe

    Ryan Lowe Guest

    "Dave Brueck" <> wrote in message
    news:...
    > 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?).
     
    Ryan Lowe, Aug 24, 2003
    #1
    1. Advertising

  2. Ryan Lowe

    John Roth Guest

    "Ryan Lowe" <> wrote in message
    news:ex42b.177723$...
    > "Dave Brueck" <> wrote in message
    > news:...
    > > 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
    >
    >
    >
    >
     
    John Roth, Aug 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Geoff Howland

    Re: python gripes survey

    Geoff Howland, Aug 24, 2003, in forum: Python
    Replies:
    7
    Views:
    344
    Colin J. Williams
    Aug 25, 2003
  2. Patrick Lioi

    Re: python gripes survey

    Patrick Lioi, Aug 25, 2003, in forum: Python
    Replies:
    3
    Views:
    314
    Jacek Generowicz
    Aug 25, 2003
  3. Dave Brueck

    Re: python gripes survey

    Dave Brueck, Aug 25, 2003, in forum: Python
    Replies:
    13
    Views:
    510
    Gonçalo Rodrigues
    Aug 28, 2003
  4. Replies:
    6
    Views:
    348
    Skip Montanaro
    Aug 25, 2003
  5. Replies:
    3
    Views:
    290
    Ville Vainio
    Aug 26, 2003
Loading...

Share This Page