diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-01-23 14:48:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-23 14:48:43 (GMT) |
commit | 1f715d5bd3bc9ff444e109b6bbd13011913681b1 (patch) | |
tree | 48d57d3cc7d95115bb895b1f59fd727409deaeae /Lib/pathlib.py | |
parent | c7f20f1cc8c20654e5d539552604362feb9b0512 (diff) | |
download | cpython-1f715d5bd3bc9ff444e109b6bbd13011913681b1.zip cpython-1f715d5bd3bc9ff444e109b6bbd13011913681b1.tar.gz cpython-1f715d5bd3bc9ff444e109b6bbd13011913681b1.tar.bz2 |
bpo-46483: change `PurePath.__class_getitem__` to return `GenericAlias` (GH-30822)
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r-- | Lib/pathlib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 04b321b..d42ee4d 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -12,6 +12,7 @@ from errno import ENOENT, ENOTDIR, EBADF, ELOOP from operator import attrgetter from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO from urllib.parse import quote_from_bytes as urlquote_from_bytes +from types import GenericAlias __all__ = [ @@ -690,8 +691,7 @@ class PurePath(object): return NotImplemented return self._cparts >= other._cparts - def __class_getitem__(cls, type): - return cls + __class_getitem__ = classmethod(GenericAlias) drive = property(attrgetter('_drv'), doc="""The drive prefix (letter or UNC path), if any.""") |