Gabriel Genellina <gagsl-...@yahoo.com.ar> added the comment:

The __getattr__ method, as written, assumes that an attribute 'args' 
already exists. That's unsafe - a more robust approach would be:

    def __getattr__(self, name):
        if 'attrs' in self.__dict__ and name in self.attrs:
            return self.attrs[name]
        raise AttributeError(name)

The suggestion of using hasattr in pickle code doesn't work, because 
hasattr is implemented using getattr.

I could not reproduce it with 2.6, nor the trunk -- there is another 
recursion problem involving __subclasscheck__ but unpickling is 
unaffected. 3.0 does show this problem. FWIW, 2.2 did not.

----------
nosy: +gagenellina

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5370>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to