mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46483: change PurePath.__class_getitem__
to return GenericAlias
(GH-30822)
This commit is contained in:
parent
c7f20f1cc8
commit
1f715d5bd3
3 changed files with 13 additions and 5 deletions
|
@ -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.""")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue