Named code blockes

Steve Holden sholden at holdenweb.com
Tue Apr 24 14:45:09 EDT 2001


"Rainer Deyke" <root at rainerdeyke.com> wrote in ...
> "Alex Martelli" <aleaxit at yahoo.com> wrote ...
> > "Rainer Deyke" <root at rainerdeyke.com> wrote ...
> > > In Python, unnamed objects have an additional benefit: there is a
single
> > > consistent way of naming them.  Consider:
> > >
> > > a = 5
> > > b = lambda: None
> > > def c():
> > >   pass
> > >
> > > These are three assignments, but only two look like assingments.  The
> >
> > They are three ways to bind (or re-bind) names, but only two of them
> > ARE "assignments" -- Python's syntax defines assignments, plain and
> > augmented, rather precisely, and there is no 'def' keyword there:-).
>
> I count four ways ('import', 'def', '=', and augmented assignment), not
> counting 'globals().set' and similar tricks.
>
Then there's class. I count five ways ...

nobody-expects-the-spanish-inquisition-ly y'rs  - steve





More information about the Python-list mailing list