wish list for python

Discussion in 'Python' started by Jim Newton, Oct 24, 2003.

  1. Jim Newton

    Jim Newton Guest

    does anyone know where i can find the current wish-list or to-do list
    for futer python releases?

    Does anyone know if there is a play to allow non-evaluatable statements
    to return values? I'm only a week to this language so far but it
    seems very strange to me (coming from a list background) that i cannot
    somehow say
    x = if a:
    then b
    else c

    or

    x = for i in some-sequence:
    blah blah blah.


    and what about something like the following?

    x = cond:
    a > 1:
    0
    a > 10:
    1
    a > 100:
    2
    True:
    -1


    ????
    -jim
    Jim Newton, Oct 24, 2003
    #1
    1. Advertising

  2. On Fri, Oct 24, 2003 at 06:47:27AM +0200, Jim Newton wrote:
    > does anyone know where i can find the current wish-list or to-do list
    > for futer python releases?


    Python Enhancement Proposals:

    http://python.org/peps/

    and the SourceForge bug/patch trackers:

    http://sourceforge.net/bugs/?group_id=5470
    http://sourceforge.net/patch/?group_id=5470

    And failing all else, try searching the comp.lang.python archives :)

    > Does anyone know if there is a play to allow non-evaluatable statements
    > to return values? I'm only a week to this language so far but it
    > seems very strange to me (coming from a list background) that i cannot
    > somehow say
    > x = if a:
    > then b
    > else c


    For this particular expression, see PEP 308 (which has been rejected).

    > x = for i in some-sequence:
    > blah blah blah.


    I'm not sure what this is meant to mean, but I suspect PEP 289 would provide
    what you're after.

    > and what about something like the following?
    >
    > x = cond:
    > a > 1:
    > 0
    > a > 10:
    > 1
    > a > 100:
    > 2
    > True:
    > -1


    See the second proposed solution in PEP 275, which is still listed as "Open"
    -- but Guido doesn't seem keen on the idea:
    http://www.python.org/doc/essays/pepparade.html

    Besides, this particular example is probably better written as:
    try:
    x = int(math.log10(a))
    except (OverflowError, ValueError):
    x = -1

    -Andrew.
    Andrew Bennetts, Oct 24, 2003
    #2
    1. Advertising

  3. Emile van Sebille, Oct 24, 2003
    #3
  4. David Eppstein, Oct 24, 2003
    #4
  5. Jim Newton

    Dave Kuhlman Guest

    Jim Newton wrote:

    [snip]

    > x = for i in some-sequence:
    > blah blah blah.


    Python has "list comprehensions" for this. Consider:

    >>> a = [-1,1,-2,2,-3,3]
    >>> a

    [-1, 1, -2, 2, -3, 3]
    >>> [x for x in a if x > 0]

    [1, 2, 3]
    >>> def f(x):

    ... return x * 3
    ...
    >>> [f(x) for x in a if x > 0]

    [3, 6, 9]
    >>>


    For more info see: ... Well, I searched but could not find any
    documentation on list comprehensions. I suppose that's the
    problem with putting every feature anyone asks for into a
    language.

    At one time, we had a nice, understandable language that even I
    could learn. Sigh.

    "I used to love her"

    I used to wake up each morning, get my breakfast in bed.
    When I had some worries she would ease my aching head.
    Now she runs around, with every man in town.
    Still trying to take me for that same old clown.
    Because I used to love her. But, it's all over now.

    -- The Animals

    Adde parvum parvo magnus acervus erit.
    [Add little to little and there will be a big pile.]

    -- Ovid, quoted from "The mythical man-month", Frederick Brooks,
    Chapter 5, "The second-system effect"

    I admit it. I'm a little grouchy this morning. My work on this
    parser thing is not going so well.

    OK. One more search and I found some documentation -- See Tutorial,
    "5.1.4 List Comprehensions":

    http://www.python.org/doc/current/tut/node7.html#SECTION007140000000000000000

    Dave

    [snap, err, I mean snip]

    --
    Dave Kuhlman
    http://www.rexx.com/~dkuhlman
    Dave Kuhlman, Oct 24, 2003
    #5
  6. Jim Newton

    David Guest

    Con fecha Fri, 24 Oct 2003 06:47:27 +0200
    Jim Newton <> escribió:

    > does anyone know where i can find the current wish-list or to-do list
    > for futer python releases?
    >
    > Does anyone know if there is a play to allow non-evaluatable
    > statements to return values? I'm only a week to this language so
    > far but it seems very strange to me (coming from a list background)
    > that i cannot somehow say
    > x = if a:
    > then b
    > else c
    >
    > or
    >
    > x = for i in some-sequence:
    > blah blah blah.
    >
    >
    > and what about something like the following?
    >
    > x = cond:
    > a > 1:
    > 0
    > a > 10:
    > 1
    > a > 100:
    > 2
    > True:
    > -1
    >


    Try Ruby! ;-)
    David, Oct 24, 2003
    #6
  7. Skip Montanaro, Oct 24, 2003
    #7
  8. >I admit it. I'm a little grouchy this morning. My work on this
    >parser thing is not going so well.


    "Work performed with attachment is a shackle, whereas work performed
    with detachment does not affect the doer. He is, even while working, in
    solitude."
    -Maharshi
    python newbie, Oct 25, 2003
    #8
  9. Jim Newton

    Jules Dubois Guest

    On Sat, 25 Oct 2003 15:25:29 GMT, in article
    <JBwmb.3255$>, python newbie wrote:

    > "Work performed with attachment is a shackle, whereas work performed
    > with detachment does not affect the doer. He is, even while working, in
    > solitude."
    > -Maharshi


    The Maharishi is a Python programmer? Wow!
    Jules Dubois, Oct 25, 2003
    #9
    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. Keith Cochrane
    Replies:
    2
    Views:
    611
    Keith Cochrane
    Aug 6, 2006
  2. Zorro

    C++ wish list and beyond

    Zorro, Jun 28, 2005, in forum: C++
    Replies:
    7
    Views:
    288
    Panjandrum
    Jun 29, 2005
  3. STEPHEN BECKER I V

    Wish list for 2.0

    STEPHEN BECKER I V, Sep 28, 2004, in forum: Ruby
    Replies:
    17
    Views:
    223
    Brian Candler
    Oct 2, 2004
  4. dave

    [PROPOSAL] mailing list

    dave, Jun 8, 2005, in forum: Ruby
    Replies:
    18
    Views:
    196
    Austin Ziegler
    Jun 10, 2005
  5. zoat
    Replies:
    25
    Views:
    327
    Peña, Botp
    Oct 31, 2006
Loading...

Share This Page