Comment #6 on issue 1717 by nicolas.pourcelot: inconsistency between facts
http://code.google.com/p/sympy/issues/detail?id=1717

"BTW, 'not is None' is more efficient than '!= None'."

I think you mean 'is not None'.

"How is "not is None" faster than "!= None"?  This is interesting to me."

As far as I know, if you use 'A is B' or 'A is not B', Python will simply  
compare A
and B memory address.
But if you use 'A == B' or 'A != B', Python will first check if A or B have  
special
comparison methods .__eq__() or .__ne__(), and if not, use memory address  
comparison.
So, that's a bit slower.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--

You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@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