static, class and instance methods (Reposting On Python-List Prohibited)

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Oct 6 04:33:11 EDT 2016


Lawrence D’Oliveiro wrote:
> 
> Every function is already a descriptor.

Which you can see with a simple experiment:

 >>> def f(self):
...  print("self =", self)
...
 >>> g = f.__get__(17, None)
 >>> g
<bound method f of 17>
 >>> g()
self = 17

-- 
Greg



More information about the Python-list mailing list