8000 functools: Give up on lazy-importing types by JelleZijlstra · Pull Request #124736 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

functools: Give up on lazy-importing types #124736

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

JelleZijlstra
Copy link
Member
@JelleZijlstra JelleZijlstra commented Sep 28, 2024

PR #121089 added an eager import for types.MethodType, but
still left the existing hacks for lazily importing from types.

We could also create MethodType internally in functools.py (e.g.,
by using type(Placeholder.__repr__), but it feels not worth it at
this point, so instead I unlazified all the usages of types in the
module.

still left the existing hacks for lazily importing from types.

We could also create MethodType internally in functools.py (e.g.,
by using `type(Placeholder.__repr__)`, but it feels not worth it at
this point, so instead I unlazified all the usages of types in the
module.
@JelleZijlstra
Copy link
Member Author

cc @serhiy-storchaka

Copy link
Member
@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should rather focus on making import types faster.

@JelleZijlstra JelleZijlstra merged commit 95581b3 into python:main Sep 29, 2024
37 checks passed
@JelleZijlstra JelleZijlstra deleted the functotypes branch September 29, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0