Skip to content

Fix dunder-method positional-only parameter discrepancies in third-party stubs #14529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brianschubert
Copy link
Member

This fixes the third-party stubtest errors from python/mypy#19593

Comment on lines +3 to +19
if sys.version_info >= (3, 11):
from enum import StrEnum

class ExchangeType(StrEnum):
direct = "direct"
fanout = "fanout"
headers = "headers"
topic = "topic"

else:
from enum import Enum

class ExchangeType(str, Enum):
direct = "direct"
fanout = "fanout"
headers = "headers"
topic = "topic"
Copy link
Member Author

Choose a reason for hiding this comment

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

note: this also needs #14523 to pass the updated stubtest

For reference: https://github.com/pika/pika/blob/1.3.2/pika/exchange_type.py

Copy link
Contributor

github-actions bot commented Aug 5, 2025

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant