Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Aug 20, 2025

  • Rather than stating that a call to NewType() returns a "dummy function" (which hasn't been true since Python 3.10), make the language more vague: describe it as returning a "dummy callable object" instead.
  • Add a cross-reference from the NewType section to a section elsewhere in the spec that discusses the interaction between NewType and Protocol

Fixes #2074

@AlexWaygood AlexWaygood added the topic: typing spec For improving the typing spec label Aug 20, 2025
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

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

This looks like a wording clarification to me, I don't think it requires full Typing Council review. Will at least wait for a second review, though.

@carljm carljm merged commit 05afd79 into main Aug 20, 2025
5 checks passed
@carljm carljm deleted the newtype-not-function branch August 20, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: typing spec For improving the typing spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec incorrectly describes the object returned by a call to NewType at runtime.

4 participants