On 1/18/08, Ross Ridge <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote:
> >The decoration is setting the class type's f1 attribute correctly, but
> >doing something strange in the local namespace.
> >
> >>>> class C:
> >...   @staticmethod
> >...   def f1(): pass
> >...   print f1
> >...
> ><staticmethod object at 0x00A69A70>
> >>>> print C.f1
> ><function f1 at 0x00A60830>
> >The class statement's local namespace is pretty strange. I think I
> >mightl go back to pretending there isn't one.
>
> When class attributes are referenced, functions are turned into unbound
> methods and staticmethod objects get turned into functions.

OK, thank you. So the local namespace is just fine, you just can't
call the staticmethod using that name directly.

-- 
Neil Cerutti <[EMAIL PROTECTED]>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to