the death of lecter

Erik Max Francis max at alcyone.com
Mon Sep 11 19:03:48 CEST 2000


Michal Wallace wrote:

>    * immediate if:
>          print 'x is', x > 0 ? 'positive' : 'negative'
> 
>      # I still wish we had a ?: operator..
>      # It would be great for lambdas!

Yeah, an if-else operation compacted into an operator would be rather
convenient.

>    * design by contract (require/ensure/implies)
>      # I still think this would be a good idea!
>      # maybe instead of keywords, they ought to be in
>      # a contract module?

Why not write your own and release it?

>    * foreach someSequence: print this
>      # where "this" is a keyword... I think this is dumb now,
>      # but the idea was to have a perl-like anonymous variable

This seems rather unnecessary; besides, Python isn't Perl, so it
shouldn't be doing all the things that Perl does.  When you can write
this as 

    for x in someSequence: print x

It's really hard to see how eliminating the x and using an anonymous
variable (with the addition of _two_ new keywords) really saves you
anything.

>    * extended 'try' syntax:
>          try:
>              print 'do something'
>          except:
>              print 'catch errors'
>          finally:
>              print 'clean up' # not allowed in real Python
> 
>       # not sure why you'd want to do this, but the fact that you
>       # can't seems kind of sad.. :)

finally is supported in Python, you just can't have it following a try
clause that also contains either an else or an except.

>    maybe someday:
>    * /regexp/  and  x =~ /regexp/
>
>      # ick! :)

Python ain't Perl.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Many things are lost for want of asking.
\__/ (an English proverb)
    Esperanto reference / http://mirror/alcyone/max/lang/esperanto/
 An Esperanto reference for English speakers.



More information about the Python-list mailing list