Should function attributes be properties?

I was expecting this to work: class myprop(property): def __get__(self, obj, cls): print "get", obj, cls def __set__(self, obj, value): print "set", obj, value def f(x): print 'f' f.p f.p = myprop() So it comes out like this: >>> f(2) f get <function f at 0x61270> None Is this a bug? Or was it not in the scope of what properties would be used for? Is this PEP material? Joel

You're misunderstanding descriptors. Descriptors only work when placed in a class. On 5/2/07, Joel Bender <jjb5@cornell.edu> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)

You're misunderstanding descriptors. Descriptors only work when placed in a class. On 5/2/07, Joel Bender <jjb5@cornell.edu> wrote:
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (3)
-
Greg Ewing
-
Guido van Rossum
-
Joel Bender