mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
gh-122445: populate only modified fields in __static_attributes__ (#122446)
(cherry picked from commit 498376d7a7
)
This commit is contained in:
parent
b20893b5c2
commit
545a328eae
5 changed files with 22 additions and 18 deletions
|
@ -2056,12 +2056,15 @@ class TestSourcePositions(unittest.TestCase):
|
|||
self.assertLessEqual(end_col, code_end)
|
||||
|
||||
|
||||
class TestExpectedAttributes(unittest.TestCase):
|
||||
class TestStaticAttributes(unittest.TestCase):
|
||||
|
||||
def test_basic(self):
|
||||
class C:
|
||||
def f(self):
|
||||
self.a = self.b = 42
|
||||
# read fields are not included
|
||||
self.f()
|
||||
self.arr[3]
|
||||
|
||||
self.assertIsInstance(C.__static_attributes__, tuple)
|
||||
self.assertEqual(sorted(C.__static_attributes__), ['a', 'b'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue