mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-118465: Add __firstlineno__ attribute to class (GH-118475)
It is set by compiler with the line number of the first line of the class definition.
This commit is contained in:
parent
716ec4bfcf
commit
153b3f7530
17 changed files with 61 additions and 89 deletions
|
@ -5088,7 +5088,8 @@ class DictProxyTests(unittest.TestCase):
|
|||
self.assertNotIsInstance(it, list)
|
||||
keys = list(it)
|
||||
keys.sort()
|
||||
self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
|
||||
self.assertEqual(keys, ['__dict__', '__doc__', '__firstlineno__',
|
||||
'__module__',
|
||||
'__static_attributes__', '__weakref__',
|
||||
'meth'])
|
||||
|
||||
|
@ -5099,7 +5100,7 @@ class DictProxyTests(unittest.TestCase):
|
|||
it = self.C.__dict__.values()
|
||||
self.assertNotIsInstance(it, list)
|
||||
values = list(it)
|
||||
self.assertEqual(len(values), 6)
|
||||
self.assertEqual(len(values), 7)
|
||||
|
||||
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
|
||||
'trace function introduces __local__')
|
||||
|
@ -5109,7 +5110,8 @@ class DictProxyTests(unittest.TestCase):
|
|||
self.assertNotIsInstance(it, list)
|
||||
keys = [item[0] for item in it]
|
||||
keys.sort()
|
||||
self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
|
||||
self.assertEqual(keys, ['__dict__', '__doc__', '__firstlineno__',
|
||||
'__module__',
|
||||
'__static_attributes__', '__weakref__',
|
||||
'meth'])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue