Skip to content

functools: Give up on lazy-importing types - #124736

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
JelleZijlstra:functotypes
Sep 29, 2024
Merged

functools: Give up on lazy-importing types#124736
JelleZijlstra merged 1 commit into
python:mainfrom
JelleZijlstra:functotypes

Conversation

@JelleZijlstra

@JelleZijlstraJelleZijlstra commented Sep 28, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

cc @serhiy-storchaka

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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:mainSep 29, 2024
@JelleZijlstra
JelleZijlstra deleted the functotypes branch September 29, 2024 13:31
Sign up for freeto 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

@JelleZijlstra@serhiy-storchaka@AlexWaygood