mirror of
https://github.com/python/cpython
synced 2026-09-29 08:25:30 +03:00
Issue #14849: setup Element data members to be assignable in subclasses
This commit is contained in:
parent
77a1cf1622
commit
b20df95827
2 changed files with 16 additions and 13 deletions
|
|
@ -1914,6 +1914,10 @@ class ElementTreeTest(unittest.TestCase):
|
|||
self.assertIsInstance(mye, MyElement)
|
||||
self.assertEqual(mye.tag, 'foo')
|
||||
|
||||
# test that attribute assignment works (issue 14849)
|
||||
mye.text = "joe"
|
||||
self.assertEqual(mye.text, "joe")
|
||||
|
||||
def test_Element_subclass_constructor(self):
|
||||
class MyElement(ET.Element):
|
||||
def __init__(self, tag, attrib={}, **extra):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue