| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Use lazy imports instead of inline imports in pprint
| lazy from dataclasses import is_dataclass | ||
| lazy from dataclasses import fields as dataclass_fields | ||
| lazy import re |
There was a problem hiding this comment.
Consider _is_dataclass, _dataclass_fields, _re as aliases instead, akin to the imports above.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks, fixed in e055683
Sorry, something went wrong.
|
Do you have any benchmarks for various use cases? |
Sorry, something went wrong.
I think this has zero impact on performance. The imports were always lazy, just inside the functions. |
Sorry, something went wrong.
|
Oh right sorry, I don't know how I missed that. I think we can close this, it's just a refactor, and IMO churn. IIRC the PEP had a section that noted this will not be done? |
Sorry, something went wrong.
|
I think so. The linked issue is about improving import times, but this PR does |
Sorry, something went wrong.
|
There are no expensive modules that pprint eagerly imports, so there's not much we can do. |
Sorry, something went wrong.
|
Yes, I'm sorry but I'm closing. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Use lazy imports instead of inline imports in pprint
CC @johnslavik