mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -4640,6 +4640,12 @@ class TestPEP519(unittest.TestCase):
|
|||
def test_pathlike_class_getitem(self):
|
||||
self.assertIsInstance(os.PathLike[bytes], types.GenericAlias)
|
||||
|
||||
def test_pathlike_subclass_slots(self):
|
||||
class A(os.PathLike):
|
||||
__slots__ = ()
|
||||
def __fspath__(self):
|
||||
return ''
|
||||
self.assertFalse(hasattr(A(), '__dict__'))
|
||||
|
||||
class TimesTests(unittest.TestCase):
|
||||
def test_times(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue