wish list for python

J

Jim Newton

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
 
A

Andrew Bennetts

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

Dave Kuhlman

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]
 
D

David

Con fecha Fri, 24 Oct 2003 06:47:27 +0200
Jim Newton said:
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! ;-)
 
P

python newbie

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
 
J

Jules Dubois

On Sat, 25 Oct 2003 15:25:29 GMT, in article
"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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top