Can a descriptor auto-detect the name of an object passed to it?
class MyDecorator( object ):
def __init__(self, wrapped):
# Detect that wrapped's name is 'some_attr' here
pass
class SomeClass( object ):
some_attr = dict()
wrapper = MyDecorator( some_attr )