Skip to content
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion Lib/test/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,10 @@ def __init__(self, arg):

from _testinternalcapi import has_inline_values

Py_TPFLAGS_MANAGED_DICT = (1 << 2)
Py_TPFLAGS_MANAGED_DICT = (1 << 4)

class NoManagedDict:
__slots__ = ('a',)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
__slots__ = ('a',)
__slots__ = ('a',)

pep 8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


class Plain:
pass
Expand All @@ -873,6 +876,13 @@ def __init__(self):
self.c = 3
self.d = 4

class TestNoManagedValues(unittest.TestCase):
def test_flags(self):
self.assertEqual(NoManagedDict.__flags__ & Py_TPFLAGS_MANAGED_DICT, 0)

def test_no_inline_values_for_slots_class(self):
c = NoManagedDict()
self.assertFalse(has_inline_values(c))

class TestInlineValues(unittest.TestCase):

Expand Down
Loading