Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ class C(A, B):
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):
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down