PR for #155 Improve Python Autofill#169
Conversation
jmshapir
left a comment
There was a problem hiding this comment.
In addition to minor housekeeping points, noting that I think (?) another change here is that autofill_formats used to to allow a list but now using a list of formats requires iterative calls. (That seems cleaner anyway but just flagging as a note.)
typechecker fails without it inspect.currentframe() is typed as returning FrameType | None — it can theoretically return None in implementations that don't support stack frames (e.g., some embedded Python runtimes). So ty complains that you're calling .f_back on something that could be None. In practice, CPython always returns a frame, so this will never actually be None in normal usage. This is just a quick suppress.
|
thanks @jmshapir. I just noticed the below
which is a good point. In d862d55 I have additionally allowed specifying a list of formats when autofilling multiple macros in one go. |
|
@zhizhongpu thanks. That sounds reasonable. I also think it could be reasonable to ask the user to iterate over autofill calls (rather than to have autofill do the iteration internally), so defer to whichever architecture you prefer. |
|
@liaochris I completely rewrote the tests and it's ready for your review. |
|
/run-actions-all --post |
|
Triggered by @zhizhongpu on this comment Check Results (run details)
|
|
Thanks for closing this pull. Before leaving the pull, please be sure you have completed all the required steps in the workflow. This includes filling in the issue summary linked at the top of this comment. |
#155 (comment)