Initial fixes for Python 3.14 #2747
Merged
+32
−15
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.
Tested against
3.14.0b1
locally. We might still need to adjust some things as more pre-release versions come out but this provides a good starting point in combination with #2731.Relevant changes for Python 3.14
typing.ByteString
andcollections.abc.ByteString
were removedhttps://docs.python.org/3.13/library/typing.html#typing.ByteString
parents
changed back topathlib._PathParents
typing.Union
was implemented in C andtypes.UnionType
is now an alias fortyping.Union
gh-105499: Merge typing.Union and types.UnionType python/cpython#105511
In theory we could think about renaming the
UnionType
class or at least think about if we want to change thepytype
attributeastroid/astroid/bases.py
Lines 738 to 742 in 5937f3d
astroid/astroid/bases.py
Lines 761 to 762 in 5937f3d