File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -859,12 +859,14 @@ def __init__(self, arg):
859859
860860from _testinternalcapi import has_inline_values
861861
862- Py_TPFLAGS_MANAGED_DICT = (1 << 2 )
862+ Py_TPFLAGS_MANAGED_DICT = (1 << 4 )
863+
864+ class NoManagedDict :
865+ __slots__ = ('a' ,)
863866
864867class Plain :
865868 pass
866869
867-
868870class WithAttrs :
869871
870872 def __init__ (self ):
@@ -873,6 +875,13 @@ def __init__(self):
873875 self .c = 3
874876 self .d = 4
875877
878+ class TestNoManagedValues (unittest .TestCase ):
879+ def test_flags (self ):
880+ self .assertEqual (NoManagedDict .__flags__ & Py_TPFLAGS_MANAGED_DICT , 0 )
881+
882+ def test_no_inline_values_for_slots_class (self ):
883+ c = NoManagedDict ()
884+ self .assertFalse (has_inline_values (c ))
876885
877886class TestInlineValues (unittest .TestCase ):
878887
You can’t perform that action at this time.
0 commit comments