Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium CodeInCategory-Code
CodeInDifficulty-Easy
New issue 2817 by [email protected]: Make sure all the built-in
__methods__ are defined
http://code.google.com/p/sympy/issues/detail?id=2817
At http://docs.python.org/reference/datamodel.html, it lists all the
__methods__ that Python works with (like __int__, __contains__, etc.). We
should go through all of these and make sure they are all defined on Basic,
Expr, or whatever relevant subclass, so that we don't have simple bugs like
In [72]: long(Integer(3))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/aaronmeurer/Documents/python/sympy/sympy/<ipython-input-72-5fff10d216fd>
in
<module>()
----> 1 long(Integer(3))
TypeError: long() argument must be a string or a number, not 'Integer'
Regarding where they should be defined, stuff that makes sense for any
object should go on Basic, stuff that makes sense only on mathematical
objects (like __add__ for example) should go on Expr, and stuff that makes
sense only for numbers (like __int__) should go in Number.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.