Skip to content

gh-119180: Lazily wrap annotations on classmethod and staticmethod - #119864

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
JelleZijlstra:pep649-staticclassm
May 31, 2024
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
JelleZijlstra:pep649-staticclassm

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 31, 2024 •

Copy link
Copy Markdown
Member
@JelleZijlstra
JelleZijlstra requested review from ambv and carljm May 31, 2024 15:25
@bedevere-app bedevere-app Bot mentioned this pull request May 31, 2024
21 of 30 tasks
@JelleZijlstra
JelleZijlstra marked this pull request as ready for review May 31, 2024 21:04
@JelleZijlstra
JelleZijlstra merged commit d28afd3 into python:main May 31, 2024
@JelleZijlstra
JelleZijlstra deleted the pep649-staticclassm branch May 31, 2024 21:05
@AlexWaygood

Copy link
Copy Markdown
Member

Hmm, what's the plan for functools.update_wrapper? Some kind of pure-Python version of this descriptor, that lazily queries the original __annotations__?

@JelleZijlstra

Copy link
Copy Markdown
Member Author

If the wrapper is a Python function, we can just copy over __annotate__, and the __annotations__ descriptor will know to call the __annotate__. If the wrapper is not a Python function, I'm not sure yet.

@JelleZijlstra

Copy link
Copy Markdown
Member Author

@AlexWaygood I implemented this in JelleZijlstra@672511a

estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@JelleZijlstra
JelleZijlstra restored the pep649-staticclassm branch September 10, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants