def __getattr__(self, name):
if name != '__setstate__':
# this avoids an infinite loop when pickle looks for the
# __setstate__ attribute before the object is initialized
with suppress(KeyError):
return self._mapping[name]
raise AttributeError("%r object has no attribute %r" %
(type(self).__name__, name))
评论列表
文章目录