Long names are doom ?

Alex Martelli aleaxit at yahoo.com
Sat May 26 05:13:35 EDT 2001


"Andrew Dalke" <dalke at acm.org> wrote in message
news:9enjr8$r4s$1 at slb6.atl.mindspring.net...
    ...
> BTW, in your proposal,
>   fn['my special function']()
>
> the [] syntax could be confused with list/dict lookup.

In Nick's proposal, the [] syntax IS exactly dict lookup, so
why say 'confused'?  Here's the relevant snippet again from
Nick's post:


fn={}

def f():
    blah..
    blah..
fn['my special function']=f
...
# call function
fn['my special function']()


I.e., a "name" (anything, really) can be used to get a function
(or anything else) by direct use of Python dictionaries.


Alex






More information about the Python-list mailing list