Skip to content

Instantly share code, notes, and snippets.

@florentin
florentin / method-demo.py
Last active October 5, 2017 12:48
Python method resolution demo
class Desc(object):
def __init__(self, msg):
self.msg = msg
def __get__(self, instance, owner=None):
return "{0}: {1}".format(self.typ, self.msg)
class NonDesc(Desc):
# non-data descriptor