| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a86122 commit 3d4d01f
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -365,24 +365,6 @@ Pure paths provide the following methods and properties: | |||
| 365 | 365 | '' | |
| 366 | 366 | ||
| 367 | 367 | ||
| 368 | - .. data:: PurePath.path | ||
| 369 | - | ||
| 370 | - A string representing the full path:: | ||
| 371 | - | ||
| 372 | - >>> PurePosixPath('my/library/setup.py').path | ||
| 373 | - 'my/library/setup.py' | ||
| 374 | - | ||
| 375 | - This always returns the same value as ``str(p)``; it is included to | ||
| 376 | - serve as a one-off protocol. Code that wants to support both | ||
| 377 | - strings and ``pathlib.Path`` objects as filenames can write | ||
| 378 | - ``arg = getattr(arg, 'path', arg)`` to get the path as a string. | ||
| 379 | - This can then be passed to various system calls or library | ||
| 380 | - functions that expect a string. Unlike the alternative | ||
| 381 | - ``arg = str(arg)``, this will still raise an exception if an object | ||
| 382 | - of some other type is given by accident. | ||
| 383 | - | ||
| 384 | - .. versionadded:: 3.4.5 | ||
| 385 | - | ||
| 386 | 368 | .. data:: PurePath.suffix | |
| 387 | 369 | ||
| 388 | 370 | The file extension of the final component, if any:: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -648,13 +648,6 @@ def __str__(self): | |||
| 648 | 648 | self._parts) or '.' | |
| 649 | 649 | return self._str | |
| 650 | 650 | ||
| 651 | - @property | ||
| 652 | - def path(self): | ||
| 653 | - try: | ||
| 654 | - return self._str | ||
| 655 | - except AttributeError: | ||
| 656 | - return str(self) | ||
| 657 | - | ||
| 658 | 651 | def as_posix(self): | |
| 659 | 652 | """Return the string representation of the path with forward (/) | |
| 660 | 653 | slashes.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -480,22 +480,6 @@ def test_name_common(self): | |||
| 480 | 480 | self.assertEqual(P('a/b.py').name, 'b.py') | |
| 481 | 481 | self.assertEqual(P('/a/b.py').name, 'b.py') | |
| 482 | 482 | ||
| 483 | - def test_path_common(self): | ||
| 484 | - P = self.cls | ||
| 485 | - def check(arg, expected=None): | ||
| 486 | - if expected is None: | ||
| 487 | - expected = arg | ||
| 488 | - self.assertEqual(P(arg).path, expected.replace('/', self.sep)) | ||
| 489 | - check('', '.') | ||
| 490 | - check('.') | ||
| 491 | - check('/') | ||
| 492 | - check('a/b') | ||
| 493 | - check('/a/b') | ||
| 494 | - check('/a/b/', '/a/b') | ||
| 495 | - check('/a/b/.', '/a/b') | ||
| 496 | - check('a/b.py') | ||
| 497 | - check('/a/b.py') | ||
| 498 | - | ||
| 499 | 483 | def test_suffix_common(self): | |
| 500 | 484 | P = self.cls | |
| 501 | 485 | self.assertEqual(P('').suffix, '') | |
@@ -919,17 +903,6 @@ def test_name(self): | |||
| 919 | 903 | self.assertEqual(P('//My.py/Share.php').name, '') | |
| 920 | 904 | self.assertEqual(P('//My.py/Share.php/a/b').name, 'b') | |
| 921 | 905 | ||
| 922 | - def test_path(self): | ||
| 923 | - P = self.cls | ||
| 924 | - self.assertEqual(P('c:').path, 'c:') | ||
| 925 | - self.assertEqual(P('c:/').path, 'c:\\') | ||
| 926 | - self.assertEqual(P('c:a/b').path, 'c:a\\b') | ||
| 927 | - self.assertEqual(P('c:/a/b').path, 'c:\\a\\b') | ||
| 928 | - self.assertEqual(P('c:a/b.py').path, 'c:a\\b.py') | ||
| 929 | - self.assertEqual(P('c:/a/b.py').path, 'c:\\a\\b.py') | ||
| 930 | - self.assertEqual(P('//My.py/Share.php').path, '\\\\My.py\\Share.php\\') | ||
| 931 | - self.assertEqual(P('//My.py/Share.php/a/b').path, '\\\\My.py\\Share.php\\a\\b') | ||
| 932 | - | ||
| 933 | 906 | def test_suffix(self): | |
| 934 | 907 | P = self.cls | |
| 935 | 908 | self.assertEqual(P('c:').suffix, '') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,12 +21,6 @@ Library | |||
| 21 | 21 | ||
| 22 | 22 | - Issue #25939: On Windows open the cert store readonly in ssl.enum_certificates. | |
| 23 | 23 | ||
| 24 | - - Issue #22570: Add 'path' attribute to pathlib.Path objects, | ||
| 25 | - returning the same as str(), to make it more similar to DirEntry. | ||
| 26 | - Library code can now write getattr(p, 'path', p) to get the path as | ||
| 27 | - a string from a Path, a DirEntry, or a plain string. This is | ||
| 28 | - essentially a small one-off protocol. | ||
| 29 | - | ||
| 30 | 24 | - Issue #26012: Don't traverse into symlinks for ** pattern in | |
| 31 | 25 | pathlib.Path.[r]glob(). | |
| 32 | 26 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments