mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
GH-104898: Add __slots__ to os.PathLike (GH-104899)
This commit is contained in:
parent
fea8632ec6
commit
bd1b6228d1
4 changed files with 10 additions and 5 deletions
|
@ -233,7 +233,7 @@ class _PathParents(Sequence):
|
|||
return "<{}.parents>".format(type(self._path).__name__)
|
||||
|
||||
|
||||
class PurePath(object):
|
||||
class PurePath(os.PathLike):
|
||||
"""Base class for manipulating paths without I/O.
|
||||
|
||||
PurePath represents a filesystem path and offers operations which
|
||||
|
@ -707,10 +707,6 @@ class PurePath(object):
|
|||
return False
|
||||
return True
|
||||
|
||||
# Can't subclass os.PathLike from PurePath and keep the constructor
|
||||
# optimizations in PurePath.__slots__.
|
||||
os.PathLike.register(PurePath)
|
||||
|
||||
|
||||
class PurePosixPath(PurePath):
|
||||
"""PurePath subclass for non-Windows systems.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue