Skip to content

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

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

gh-119180: Lazily wrap annotations on classmethod and staticmethod#119864
JelleZijlstra merged 1 commit intopython:mainfrom
JelleZijlstra:pep649-staticclassm

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 31, 2024

@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
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
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
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
Member Author

@AlexWaygood I implemented this in JelleZijlstra@672511a

noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
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