| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
This is a change in a private module that should not be user facing so I don't think blurb is needed? |
Sorry, something went wrong.
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?
Sorry, something went wrong.
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 get_annotations now has to build a bunch of ForwardRef objects1. Footnotes
|
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…148408) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Fixes #148406, using an approach suggested in the issue.
Test plan
Before
After
Also added a regression tests to ensure that re module is not imported during _colorize import.
We've just made re import lazy in dataclasses (#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 the re module).