Created
November 9, 2015 15:49
-
-
Save bsmithyman/b911458fe780f146d403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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