File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ class ABC(metaclass=ABCMeta):
235235 """Helper class that provides a standard way to create an ABC using
236236 inheritance.
237237 """
238- pass
238+ __slots__ = ()
239239
240240
241241def get_cache_token ():
Original file line number Diff line number Diff line change @@ -402,6 +402,9 @@ class C(A, B):
402402 C ()
403403 self .assertEqual (B .counter , 1 )
404404
405+ def test_ABC_has___slots__ (self ):
406+ self .assertTrue (hasattr (abc .ABC , '__slots__' ))
407+
405408
406409class TestABCWithInitSubclass (unittest .TestCase ):
407410 def test_works_with_init_subclass (self ):
Original file line number Diff line number Diff line change @@ -345,6 +345,9 @@ Extension Modules
345345Library
346346-------
347347
348+ - bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers
349+ to deny __dict__ and __weakref__ creation. Patch by Aaron Hall.
350+
348351- bpo-30520: Loggers are now pickleable.
349352
350353- bpo-30557: faulthandler now correctly filters and displays exception codes
You can’t perform that action at this time.
0 commit comments