[Python-Dev] unnamed defs

IxokaI ixokai at gmail.com
Thu Jul 29 09:39:25 CEST 2004


Forgive a lurker, but...

> Being unsatisfied with the way lambda works, i wondered what would the python
> guys think of this:
> 
> class X:
> ____my_static_method = staticmethod(def (x, y): {
> ________some statements
> ____})

I can't think of any reason why you wouldn't want to do:

class X:
    def myStaticMethod(x, y):
        some statements
    myStaticMethod = staticmethod(myStaticMethod)

I know its just an example, but I just don't get the allure of
anonymous functions. There's no extra typing in this example, its not
any more clear, and in fact, it looks less clear to me. That doesn't
jump out at me saying 'function definition!'. And in situations where
it may be less typing, its still IMHO always less clear.

--Stephen


More information about the Python-Dev mailing list