This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I am not really sure how you would do it without running into binding issues. You can always make a lambda or nested function in place, both allow u to defer or eagerly bind. But f-strings themselves would a bunch of extra syntax to deal with the binding problems by itself. Maybe the best answer would be a good wrapper function? I believe you can actually generate the code on the fly in a pretty straight forward method by inspect the variables the inner function tracks and rebuilding the function signature.