map/filter/reduce/lambda opinions and background unscientific mini-survey

Ron Adam rrr at ronadam.com
Fri Jul 8 01:20:15 EDT 2005


Erik Max Francis wrote:
> Ron Adam wrote:
> 
>> Well in my previous explanation I *mean* it to be empty parenthesis.
>>
>> Does that help?
> 
> 
> Maybe it might be beneficial to learn a little more of the language 
> before proposing such wide-reaching (and un-Pythonic) reforms?

Hi Erik,

Getting more sleep is the answer to not making those kinds of oversights 
in this case.

It's really was not a (my) proposal, but a suggestion someone else made. 
  It seemed like an interesting idea and I wanted to see what kind of 
problems and benefits it would have.  Discussing an idea with other 
before it's fully thought out is a good way to explore its possibilities 
even though it may mean appearing silly at times, which I don't mind. :)

In the previous posts I was attempting to show a possible pattern or 
logic which doesn't currently correspond to the languages syntax using 
parenthesis.

 >>> (None)
 >>>

That's as close to an empty parenthesis as Python gets.  I was really 
trying to explain an underlying concept, not show actual python code.

And the conclusion (opinion) I've come to, is such a change might be 
made to work, but it would be very confusing to most people who have 
gotten use to the current None usage.  And difficult to emplement in a 
way that's consistant overall.

An alternative is to use a different word such as 'undefined'.  Then 
None can be used as it is currently, and undefined, can be used to test 
for in a comparison for undefined names.  Assigning a name to undefined 
could be used as an alternative to delete a name but so far I don't see 
an advantage to doing that way over using del.



    if name is undefined: do something.

Instead of:

    try:
       name
    except:
       do something


And maybe:

     name = undefined

can be used in expressions where del name can't?

But so far this doesn't seem useful enough to propose and it would 
probably cause more problems (or confusion) than it solves.

Cheers,
Ron



More information about the Python-list mailing list