Minidom.Node不会调用__getattr__ [英] Minidom.Node doesn't call __getattr__
本文介绍了Minidom.Node不会调用__getattr__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用minidom解析XML并简化访问子节点,我正在尝试为Node类实现__getattr__。是的,我知道大多数人会想到这一点;我只需要小心,不是我。)
I''m using minidom to parse XML and to simplify accessing child nodes, I''m trying to implement __getattr__ for the Node class. Yes, I know what most of you will think of that; I''ll just have to be careful, won''t I. ;)
展开 | 选择 | Wrap | 行号
推荐答案
如果你试图调用__getattr__,你需要()。
If you''re trying to call __getattr__ you need ().
如果你打算打电话__getattr__你需要()。
If you''re trying to call __getattr__ you need ().
不试图调用它 - 我正在覆盖它。
Not trying to call it - I''m overriding it.
不要试着打电话 - 我正在压倒它。
Not trying to call it - I''m overriding it.
我不知道......但你仍然需要getChild需要的(名称)参数
No I know that... but you still need the (name) arguments that getChild needs
这篇关于Minidom.Node不会调用__getattr__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文