gh-111874: Call __set_name__ on objects that define the method inside a typing.NamedTuple class dictionary as part of the creation of that class (#111876)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Alex Waygood 2023-11-27 16:34:44 +00:00 committed by GitHub
parent ffe1b2d07b
commit 22e411e1d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 99 additions and 3 deletions

View file

@ -0,0 +1,4 @@
When creating a :class:`typing.NamedTuple` class, ensure
:func:`~object.__set_name__` is called on all objects that define
``__set_name__`` and exist in the values of the ``NamedTuple`` class's class
dictionary. Patch by Alex Waygood.