-
Notifications
You must be signed in to change notification settings - Fork 30
other compatibility hacks remaining from experiment branch #921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Test Results 6 files 6 suites 7m 21s ⏱️ Results for commit f903de7. ♻️ This comment has been updated with latest results. |
If #920 and this are marged, one can start testing the changes outsourced to qupulse_hdawg to converge to a working main branch covering the features required for usage at the experiments / with elicit |
I do not understand the purpose of this hack. I remember we discussed it already somewhere... A proper hack would be to do def get_caller_self():
frame = sys._getframe(2)
try:
return frame.f_locals.get('self')
finally:
# LLM suggested that to avoid reference cycles. Unsure if necessary. I do not think so
del frame
class A:
def call_stuff(self):
stuff()
def stuff():
print('called by', get_caller_self()) |
the LLM advises against sys._getframe for being a private CPython implementation detail |
Therefore, it is a proper hack. Yet the better way is to use inspect import inspect
def get_caller_self():
inspect.currentframe().f_back.f_back.f_locals.get('self')
class A:
def call_stuff(self):
stuff()
def stuff():
print('called by', get_caller_self()) |
Touché. i‘ve called a friend of mine who‘s an expert on hacks and he said: |
Luckily, nobody uses pypy |
if you say nicer code syntax > robustness i'll move it to qupulse-hdawg via the hack |
Its less about nicer syntax and more about trying to keep the abstraction layer clean to make code easier to reason about. |
I get & agree that in idealistic scenarios it would be nicer to keep every concept nicely separated, but the reason that so far it was done this way is that otherwise "a lot" of metadata-clutter about the nature of the loop that is to be built a program of, e.g. its inner variables, identifier, etc., would need to be provided to the |
No description provided.