You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defer inspect import and lazy-load converters/validators
Move `import inspect` from module level to first use in `_compat.py`
and `_make.py`. Lazy-load `converters` and `validators` submodules
via `__getattr__` in both `attr` and `attrs` packages.
This avoids importing `inspect` (which pulls in ast, re, dis,
tokenize, etc.) at `import attr` time, reducing import time by ~25%.
Deferred the import of `inspect` and the loading of the `validators` and `converters` submodules until first use, reducing `import attr`/`import attrs` time by ~25%.
0 commit comments