Skip to content

Fix Final literal values in various third-party stubs#15521

Merged
JelleZijlstra merged 1 commit intopython:mainfrom
brianschubert:stubs-fix-literal-constants
Mar 16, 2026
Merged

Fix Final literal values in various third-party stubs#15521
JelleZijlstra merged 1 commit intopython:mainfrom
brianschubert:stubs-fix-literal-constants

Conversation

@brianschubert
Copy link
Collaborator

Found by running stubtest with python/mypy#20858

_Observer: TypeAlias = Callable[[StateMachine[_Context]], None]

__docformat__: Final = "reStructuredText"
__docformat__: Final = "restructuredtext"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BLACK: Final = "00000000"
WHITE: Final = "00FFFFFF"
BLUE: Final = "00FFFFFF"
BLUE: Final = "000000FF"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The runtime values have an actual embedded tab character, not \ t
https://github.com/Pylons/waitress/blob/main/src/waitress/rfc7230.py

Comment on lines +88 to +90
COMPILE_LIBCURL_VERSION_NUM: Final[int]
COMPILE_PY_VERSION_HEX: Final[int]
COMPILE_SSL_LIB: Final[str]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unstable, depend on the versions the module was compiled with

HTTPAUTH_NTLM: Final = 8
HTTPAUTH_NTLM_WB: Final = 32
HTTPAUTH_ONLY: Final = -2147483648
HTTPAUTH_ONLY: Final[int]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Value differs between platforms: -2147483648 on the Windows runners, +2147483648 on the MacOS and Linux runners

@github-actions
Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit 61524fa into python:main Mar 16, 2026
39 checks passed
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.

2 participants