def __delattr__(self, name):
# avoid infinite recursion
if name in Alias.__slots__:
raise TypeError("'dictproxy' object does not support item deletion")
if name in Alias._component_slots:
del super(Alias, self).__dict__[name]
if self.aliased_object is None:
raise weakref.ReferenceError("Proxy is not longer valid")
return delattr(self.aliased_object, name)
#
# In addition to overloading __getattr__, the following magic
# methods need to be redirected as Python does not access them
# through __getitem__. If the aliased object does not implement
# them an exception will be thrown
#
# E.g., IndexedComponent
评论列表
文章目录