Uh oh!
There was an error while loading. Please reload this page.
gh-148406: Fix annotations of _colorize.FancyCompleter - #148408
Conversation
danielhollas
commented
Apr 11, 2026
This is a change in a private module that should not be user facing so I don't think blurb is needed? |
Uh oh!
There was an error while loading. Please reload this page.
sobolevn
left a comment
There was a problem hiding this comment.
One more idea: there's a special section for type imports in if False: right below. Maybe you should utilize it?
DavidCEllis
commented
Apr 12, 2026
I think that's only worth doing if the import is slow (so for typing it makes sense), otherwise you're just making the runtime annotations worse which will technically make the dataclass construction ever so slightly slower as Footnotes
|
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
…148408) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Fixes#148406, using an approach suggested in the issue.
Test plan
Before
After
Also added a regression tests to ensure that
remodule is not imported during_colorizeimport.We've just made
reimport lazy indataclasses(#148379), but because of the bug resolved here, it ended up being imported (because the annotations were strings, which was triggering the path that uses theremodule)._colorize.FancyCompleterdataclass are funky #148406