Issue 243 in mpmath: Equality testing for matrices assumes that entities tested are, in fact, matrices

2 views
Skip to first unread message

mpm...@googlecode.com

unread,
Sep 11, 2013, 9:55:38 AM9/11/13
to mpmath...@googlegroups.com
Status: New
Owner: ----

New issue 243 by welc...@ksu.edu: Equality testing for matrices assumes
that entities tested are, in fact, matrices
http://code.google.com/p/mpmath/issues/detail?id=243

What steps will reproduce the problem?

import mpmath as MP
BigMat=None # initialize a symbol that might or might not be used

# Work that may or may not create BigMat depending on circumstances
# but which, in a particular instance, does happen to execute...
BigMat=MP.matrix([1,2,3])
# ... and then later, to see if the program took that path one tries..

if BigMat==None:
blah..
else:
blah blah...

What is the expected output?
The expected result would be a False or True branch in the "if" statement
depending on whether BigMat had or had not been created by the particular
workflow.

What do you see instead?
669 def __eq__(self, other):
--> 670 return self.__rows == other.__rows and self.__cols ==
other.__cols \
671 and self.__data == other.__data
672

AttributeError: 'NoneType' object has no attribute '_matrix__rows'

What version of the product are you using? On what operating system?

0.17 on Windows 7 (64-bit)

Please provide any additional information below.

Entities can fail to be equal for lots of reasons; a solution would be to
preface tests with guard statements generating appropriate returns when
apples and oranges are compared.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages