mirror of
https://github.com/python/cpython.git
synced 2024-11-27 20:04:41 +08:00
bpo-30463: Add an empty __slots__ to abc.ABC.
This commit is contained in:
parent
ec19ba210b
commit
ff48739ed0
@ -235,7 +235,7 @@ class ABC(metaclass=ABCMeta):
|
||||
"""Helper class that provides a standard way to create an ABC using
|
||||
inheritance.
|
||||
"""
|
||||
pass
|
||||
__slots__ = ()
|
||||
|
||||
|
||||
def get_cache_token():
|
||||
|
@ -402,6 +402,9 @@ class TestABC(unittest.TestCase):
|
||||
C()
|
||||
self.assertEqual(B.counter, 1)
|
||||
|
||||
def test_ABC_has___slots__(self):
|
||||
self.assertTrue(hasattr(abc.ABC, '__slots__'))
|
||||
|
||||
|
||||
class TestABCWithInitSubclass(unittest.TestCase):
|
||||
def test_works_with_init_subclass(self):
|
||||
|
@ -345,6 +345,9 @@ Extension Modules
|
||||
Library
|
||||
-------
|
||||
|
||||
- bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers
|
||||
to deny __dict__ and __weakref__ creation. Patch by Aaron Hall.
|
||||
|
||||
- bpo-30520: Loggers are now pickleable.
|
||||
|
||||
- bpo-30557: faulthandler now correctly filters and displays exception codes
|
||||
|
Loading…
Reference in New Issue
Block a user