Skip to content
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

bpo-46483: [doc] Remove pathlib classes from list of stdlib classes that can be parameterized at runtime #31281

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Feb 11, 2022

__class_getitem__ has been removed from pathlib.PurePath due to the fact that it was only added to the class by mistake (the class was never really generic). This means that PurePath (and subclasses of PurePath) can no longer be parameterized at runtime. Therefore, these pathlib classes should be removed from the list in stdtypes.rst of classes that can be parameterized at runtime.

https://bugs.python.org/issue46483

…nerics in 3.11

`__class_getitem__` has been removed from `pathlib.PurePath` due to the fact that it was only added to the class by mistake (the class was never really generic). This means that `PurePath` (and subclasses of `PurePath`) can no longer be parameterized at runtime. Therefore, these `pathlib` classes should be removed from the list in `stdtypes.rst` of classes that can be parameterized at runtime.
@JelleZijlstra
Copy link
Member

Do you think we should backport this change? The classes will remain parameterizable in 3.10, but the list already promises to be non-exhaustive, so we might as well remove these classes so we don't draw more attention to the previous incorrect behavior.

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Feb 11, 2022

We might as well remove these classes so we don't draw more attention to the previous incorrect behavior.

Yes, good idea. They were also only added to this list fairly recently (prior to @sobolevn's PR removing __class_getitem__ from PurePath) by, er, me, so if we remove them now hopefully nobody will notice they were ever there ;)

@AlexWaygood AlexWaygood added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Feb 11, 2022
@miss-islington
Copy link
Contributor

Thanks @AlexWaygood for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @AlexWaygood and @serhiy-storchaka, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker e0bc8ee945af96f9395659bbe3cc30b082e7a361 3.10

@bedevere-bot
Copy link

GH-31286 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Feb 11, 2022
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.9 only security fixes label Feb 11, 2022
@miss-islington
Copy link
Contributor

Thanks @AlexWaygood for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 11, 2022
…rics (pythonGH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
(cherry picked from commit e0bc8ee)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood AlexWaygood deleted the patch-2 branch February 11, 2022 20:41
@serhiy-storchaka serhiy-storchaka added needs backport to 3.10 only security fixes and removed needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Feb 11, 2022
@miss-islington
Copy link
Contributor

Thanks @AlexWaygood for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 11, 2022
…rics (pythonGH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
(cherry picked from commit e0bc8ee)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 11, 2022
@bedevere-bot
Copy link

GH-31287 is a backport of this pull request to the 3.10 branch.

miss-islington added a commit that referenced this pull request Feb 11, 2022
…rics (GH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
(cherry picked from commit e0bc8ee)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
miss-islington added a commit that referenced this pull request Feb 11, 2022
…rics (GH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
(cherry picked from commit e0bc8ee)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood
Copy link
Member Author

Thanks @serhiy-storchaka!

@serhiy-storchaka serhiy-storchaka removed their assignment Apr 25, 2022
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…rics (pythonGH-31281)

Remove pathlib classes from the list in stdtypes.rst of classes
that can be parameterized at runtime.
(cherry picked from commit e0bc8ee)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants