We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Py_TPFLAGS_MANAGED_DICT
test_class.py
1 parent 2301cdb commit 407de3cCopy full SHA for 407de3c
Lib/test/test_class.py
@@ -859,7 +859,10 @@ def __init__(self, arg):
859
860
from _testinternalcapi import has_inline_values
861
862
-Py_TPFLAGS_MANAGED_DICT = (1 << 2)
+Py_TPFLAGS_MANAGED_DICT = (1 << 4)
863
+
864
+class NoManagedDict:
865
+ __slots__ = ('a',)
866
867
class Plain:
868
pass
@@ -873,6 +876,13 @@ def __init__(self):
873
876
self.c = 3
874
877
self.d = 4
875
878
879
+class TestNoManagedValues(unittest.TestCase):
880
+ def test_flags(self):
881
+ self.assertEqual(NoManagedDict.__flags__ & Py_TPFLAGS_MANAGED_DICT, 0)
882
883
+ def test_no_inline_values_for_slots_class(self):
884
+ c = NoManagedDict()
885
+ self.assertFalse(has_inline_values(c))
886
887
class TestInlineValues(unittest.TestCase):
888
0 commit comments