mirror of
https://github.com/python/cpython.git
synced 2025-09-01 22:47:59 +00:00
GH-128520: Merge pathlib._abc
into pathlib.types
(#130747)
There used to be a meaningful distinction between these modules: `pathlib` imported `pathlib._abc` but not `pathlib.types`. This is no longer the case (neither module is imported), so we move the ABCs as follows: - `pathlib._abc.JoinablePath` --> `pathlib.types._JoinablePath` - `pathlib._abc.ReadablePath` --> `pathlib.types._ReadablePath` - `pathlib._abc.WritablePath` --> `pathlib.types._WritablePath`
This commit is contained in:
parent
321bf59512
commit
d0eb01c9de
4 changed files with 406 additions and 410 deletions
|
@ -1059,14 +1059,14 @@ class PathTest(test_pathlib_abc.RWPathTest, PurePathTest):
|
|||
return d
|
||||
|
||||
def test_matches_writablepath_docstrings(self):
|
||||
path_names = {name for name in dir(pathlib._abc.WritablePath) if name[0] != '_'}
|
||||
path_names = {name for name in dir(pathlib.types._WritablePath) if name[0] != '_'}
|
||||
for attr_name in path_names:
|
||||
if attr_name == 'parser':
|
||||
# On Windows, Path.parser is ntpath, but WritablePath.parser is
|
||||
# posixpath, and so their docstrings differ.
|
||||
continue
|
||||
our_attr = getattr(self.cls, attr_name)
|
||||
path_attr = getattr(pathlib._abc.WritablePath, attr_name)
|
||||
path_attr = getattr(pathlib.types._WritablePath, attr_name)
|
||||
self.assertEqual(our_attr.__doc__, path_attr.__doc__)
|
||||
|
||||
def test_concrete_class(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue