diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-11-09 18:21:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-09 18:21:53 +0000 |
commit | 0f47a3199c51ba7c49e72b4c645dbf599aa17be4 (patch) | |
tree | 0af8152972d48f0b6f379fb5f6c7761e868d897b /Lib/test/test_pathlib/test_pathlib_abc.py | |
parent | 6293d00e7201f3f28b1f4512e57dc4f03855cabd (diff) | |
download | cpython-0f47a3199c51ba7c49e72b4c645dbf599aa17be4.tar.gz cpython-0f47a3199c51ba7c49e72b4c645dbf599aa17be4.zip |
pathlib ABCs: support initializing paths with no arguments (#126608)
In the past I've equivocated about whether to require at least one argument
in the `PurePathBase` (and `PathBase`) initializer, and what the default
should be if we make it optional. I now have a local use case that has
persuaded me to make it optional and default to the empty string (a
`zipp.Path`-like class that treats relative and absolute paths similarly.)
Happily this brings the base class more in line with `PurePath` and `Path`.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib_abc.py')
-rw-r--r-- | Lib/test/test_pathlib/test_pathlib_abc.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib_abc.py b/Lib/test/test_pathlib/test_pathlib_abc.py index d155e7c5bb9..bb2e4187ef9 100644 --- a/Lib/test/test_pathlib/test_pathlib_abc.py +++ b/Lib/test/test_pathlib/test_pathlib_abc.py @@ -148,6 +148,7 @@ class DummyPurePathTest(unittest.TestCase): P = self.cls p = P('a') self.assertIsInstance(p, P) + P() P('a', 'b', 'c') P('/a', 'b', 'c') P('a/b/c') |