Protocols in typing extensions by ilevkivskyi · Pull Request #464 · python/typing · GitHub

github.com

Tin mới

ilevkivskyi:protocols-typing-extensions

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Security and quality 0

Adapt Protocol and runtime from PR

An attempt to fix missing failure on some versions

Fix missing import

Fix another missing import

And another missing import

Abandon attempts to support protocols in 3.5.0 and 3.5.1, see

Attempt to keep support of 3.5.2

Hopefully last backward compatibility nit

Skip some irrelevant tests

Conditionally add Protocol and runtime to __all__

Add Protocol and runtime to typing_extensions python/typeshed#1564

User-defined protocols python/mypy#3838

View reviewed changes

Learn more about hiding disruptive comments

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

Tweaks following Jelle's comments

View reviewed changes

https://github.com/python/cpython/blob/master/Lib/_collections_abc.py#L151

Just checking for None attribute in the class sounds like a good idea, thought it wouldn't be enough by itself. For example, B could be defined like:

Release typing_extensions to PyPI #467

Backport latest changes and tests on Python 2

Fix Python 3.6+ tests

One more Python 3.6+ fix

Apply the None rule only to callable protocol members. python/mypy#3938

Prohibit issubclass() for runtime protocols with non-method members python/mypy#3939

View reviewed changes

https://github.com/notifications/unsubscribe-auth/ACwrMnwKqTCk30rbmrhw7ECcJwWD-Ai6ks5siZQHgaJpZM4O8UJj

https://github.com/notifications/unsubscribe-auth/ACwrMuKOtls0Yg8-zFW1Z0vU4go77u0Aks5siZmqgaJpZM4O8UJj

View reviewed changes

typing_extensions/src_py3/test_typing_extensions.py

Minor updates to protocol semantics python/mypy#3996

Minor updates to protocol semantics (

python/cpython#89138

Yes, still valid. See python/cpython#89138 In general, please avoid commenting on long closed pull requests.