Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Blorgle(object):
@property
def incompatible(self):
import inspect
frame = inspect.currentframe()
print('Current')
print(frame.f_locals.get('self', None))
print('Previous')
print(frame.f_back.f_locals.get('self', None))
print('2Prev')
print(frame.f_back.f_back.f_locals.get('self', None))
print('3Prev')
print(frame.f_back.f_back.f_back.f_locals.get('self', None))
def checkCaller(self):
return self.incompatible
class Florgle(object):
def callOther(self, other):
return other.checkCaller()
a = Blorgle()
b = Florgle()
b.callOther(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment