-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Dedent fixes for Python 3.12 #959
Conversation
Also tag @riedgar-ms -- I may have put the tests in the wrong place, I saw "test_call_embeddings" inside of "test_model" which feels spiritually similar to the dedent semantics, but I'm really not sure where the right place is in the new framework. Happy to move these anywhere really |
Looks like a reasonable location to me. |
Nice @Harsha-Nori! The solution is also a lot more readable than what was there before. Regarding location, I think it's fine where it is, but I'd consider making a new file |
source = " \n".join( | ||
lines | ||
) # TODO: this does not quite work because new_code_obj is now the __outer__closure_wrap() function...could be fixed with work... | ||
# lines = source.split("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these commented blocks (in the tests as well) be deleted before merge, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK if we leave them in? The logic here is annoyingly tricky and while it's not feature complete yet, will be important to replicate when we extend the decorator to nested function definitions
@riedgar-ms @Harsha-Nori any objections to merging this? |
Thanks for approving @hudson-ai and @riedgar-ms! |
Aiming to fix #942
This should handle general use cases across Python versions, but further fixes are probably still needed for:
I think these are both esoteric enough that we can kick the can down the road, but I'll keep thinking about it.
@mmoskal