KEMBAR78
gh-110682: Ignore `__match_args__` from `__instancecheck__` in protocols by sobolevn · Pull Request #110683 · python/cpython · GitHub
Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 11, 2023

@sobolevn sobolevn changed the title gh-110682: Ignore __match_args__ from __intancecheck__ in protocols gh-110682: Ignore __match_args__ from __instancecheck__ in protocols Oct 11, 2023
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I think this makes sense, thanks! Not sure if we should backport or not; I lean towards no? What do you think? :)

@sobolevn
Copy link
Member Author

For me - this is a bugfix, this makes Protocol much easier to work with (in terms of patma).
So, I am +1 on backporting these changes.

…XRFaX.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM. I'll wait a little while in case any other maintainers disagree, or have any thoughts on whether it should be backported.

@AlexWaygood AlexWaygood added topic-typing stdlib Standard Library Python modules in the Lib/ directory labels Oct 11, 2023
@gvanrossum
Copy link
Member

I think it's more than a bugfix. It can cause quite significant changes is user code behavior. Let's not backport it, so if user code has a dependency on this (that they probably don't even know about), they won't have to debug and fix it when they install a bugfix upgrade of CPython.

@JelleZijlstra
Copy link
Member

Agree with Guido, but I'd be OK with making this change in typing-extensions and including it in the next feature release.

@JelleZijlstra JelleZijlstra merged commit 5257ade into python:main Oct 12, 2023
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Dec 11, 2023
# Release 4.9.0 (December 9, 2023)

This feature release adds `typing_extensions.ReadOnly`, as specified
by PEP 705, and makes various other improvements, especially to
`@typing_extensions.deprecated()`.

There are no changes since 4.9.0rc1.

# Release 4.9.0rc1 (November 29, 2023)

- Add support for PEP 705, adding `typing_extensions.ReadOnly`. Patch
  by Jelle Zijlstra.
- All parameters on `NewType.__call__` are now positional-only. This means that
  the signature of `typing_extensions.NewType.__call__` now exactly matches the
  signature of `typing.NewType.__call__`. Patch by Alex Waygood.
- Fix bug with using `@deprecated` on a mixin class. Inheriting from a
  deprecated class now raises a `DeprecationWarning`. Patch by Jelle Zijlstra.
- `@deprecated` now gives a better error message if you pass a non-`str`
  argument to the `msg` parameter. Patch by Alex Waygood.
- `@deprecated` is now implemented as a class for better introspectability.
  Patch by Jelle Zijlstra.
- Exclude `__match_args__` from `Protocol` members.
  Backport of python/cpython#110683 by Nikita Sobolev.
- When creating a `typing_extensions.NamedTuple` class, ensure `__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,
  backporting python/cpython#111876.
- Improve the error message when trying to call `issubclass()` against a
  `Protocol` that has non-method members. Patch by Alex Waygood (backporting
  python/cpython#112344, by Randolph Scholz).
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…protocols (python#110683)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Standard Library Python modules in the Lib/ directory topic-typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants