Comment #4 on issue 2608 by vlada.pe...@gmail.com: test_pickling errors under Python 3
http://code.google.com/p/sympy/issues/detail?id=2608

Yes, a quick search leads me to this issue upstream: http://bugs.python.org/issue9666 ("'hasattr' fix to suppress only AttributeError"). To quote the discussion linked to in the issue (also worth a read):

"
    >>> class Test:
    ...     @property
    ...     def attr(self):
    ...         self['foo']
    ...
    >>> hasattr(Test(), 'attr')
    False

There can be any exception instead of KeyError in the above snippet of code, but this small example shows how 'hasattr': misleadingly breaks the code logic (1) and masks bug (2).
"
(this is exactly the code we use in the Printer class, btw)

So yeah, this basically means some/many of our properties are actually wrong and we needed a port to Python 3 and an obscure pickle test to see this. For the two cases I catch here I have a fix, but this is probably something that should be checked/modified all around SymPy.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to