Look at this code:
class MyClass():
# Why does this give me \"NameError: name \'self\' is not defined\":
mySelf = self
# But this does not?
self is just a name, your self in this case is a class variable and not this for the object using which it is called,
self is treated as a normal variable and it is not defined, where as the self in the function comes from the object used for calling.
you want to treat the object reference in self as a class variable which is not possible.