← 返回首页
gh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols by AlexWaygood · Pull Request #104622 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols#104622

Merged
AlexWaygood merged 1 commit into
python:mainfrom
AlexWaygood:concrete-proto-subclasses
May 18, 2023
Merged

gh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols#104622
AlexWaygood merged 1 commit into
python:mainfrom
AlexWaygood:concrete-proto-subclasses

Conversation

AlexWaygood commented May 18, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

This was a small oversight in #103160. It's not a huge issue by any means, but there's no reason to set the special __protocol_attrs__ and __callable_proto_members_only__ attributes for concrete subclasses of protocols, and if we skip doing so, we speedup class creation by around 33%.

(Skipping news, since this fixes a small oversight in a commit that hasn't been included in any released version of Python.)

AlexWaygood merged commit f7835fc into python:main May 18, 2023
AlexWaygood deleted the concrete-proto-subclasses branch May 18, 2023 23:34
carljm added a commit to carljm/cpython that referenced this pull request May 18, 2023
* main: pythongh-74690: Don't set special protocol attributes on non-protocol subclasses of protocols (python#104622) pythongh-104623: Update Windows installer to use SQLite 3.42.0 (python#104625) pythongh-104050: Add more type annotations to Argument Clinic (python#104628) pythongh-104629: Don't skip test_clinic if _testclinic is missing (python#104630) pythongh-104549: Set __module__ on TypeAliasType (python#104550) pythongh-104050: Improve some typing around `default`s and sentinel values (python#104626) pythongh-104146: Remove unused vars from Argument Clinic (python#104627) pythongh-104615: don't make unsafe swaps in apply_static_swaps (python#104620) pythonGH-104484: Add case_sensitive argument to `pathlib.PurePath.match()` (pythonGH-104565) pythonGH-96803: Document and test new unstable internal frame API functions (pythonGH-104211) pythonGH-104580: Don't cache eval breaker in interpreter (pythonGH-104581)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Footer

© 2026 GitHub, Inc.