Repository navigation
Keep from python_utils.types import * working on Python 3.15 - #70
Merged
Merged
Conversation
Python 3.15 removed `typing.ByteString` and `typing.no_type_check_decorator`, so `from typing import *` no longer provides them, but both were still listed in `__all__` and the star import raised `AttributeError`. List them only on Python < 3.15. Add regression tests that every `__all__` entry resolves and that the star import exports all of them, and run the test suite on 3.15 in CI and tox.
maoxor
force-pushed
the
fix/python-3.15-star-import
branch
from
October 29, 2026 16:00
9b7b877 to
c260f27
Compare
wolph
added a commit
that referenced
this pull request
Nov 1, 2026
#70 appended ByteString and no_type_check_decorator to the end of __all__ on Python 3.10 to 3.14. They stay at their 4.1.4 positions and are removed only on 3.15, where typing no longer defines them. A test pins the positions.
wolph
added a commit
that referenced
this pull request
Nov 1, 2026
Owner
|
Thank you for the fix! I've moved the two names back to their old positions in |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Python 3.15.0,
from python_utils.types import *fails:3.15 removed
typing.ByteStringandtyping.no_type_check_decorator, sofrom typing import *no longer brings them in, but both are still listed in__all__.import python_utils.typesand attribute access keep working, and the whole suite passes on 3.15, which is why nothing caught it.This lists those two names in
__all__only on Python < 3.15 (the same cuttyping_extensionsuses forno_type_check_decorator). On 3.10 to 3.14 the exported names don't change. I also added 3.15 to the CI matrix, the tox envs and the classifiers, so the new tests actually run there.Two small choices you may want to know about:
# pragma: no coverrather thanno branch, becausetox -e coverageruns on a single interpreter, where a version-gated line is always missed on one side. It's the same pragma as the star imports just above.__all__.extend(...)rather than+=: with+=, basedpyright reported__all__as unknown intest_types.py.Tests
Two regressions in
test_types.py: every name in__all__resolves, and the star import exports all of them. On 3.15 both fail without the change and pass with it; on 3.14 they pass either way.What I ran (macOS arm64, CPython from uv)
tox -e py310,py311,py312,py313,py314,py315,lint,mypy,pyright,pyrefly,codespell,docs: all OK, 435 tests on each interpreter.tox -e coverageon 3.10, 3.13 and 3.15: 100%. I also combined py310 + py314 + py315 data the way the CIcoveragejob does: 100%.python -W error -c "from python_utils.types import *"works.Side note, unrelated to this change: running
tox -plocally sometimes ends with anINTERNALERRORfrom coverage (FileNotFoundErrorwhile renaming a.coverage.*file), because the parallel envs share data files in the repo root. I hit it ondeveloptoo (1 run out of 5). Happy to send a separate PR if that's useful.