On Apr 20, 2010, at 5:35 PM, Jason Grout wrote:

Hi all,

In sage/devel/symbolic/ring.pyx, I find this in the SymbolicRing.__init__:

self._populate_coercion_lists_(convert_method_name='_symbolic_')

Later on, I find this in SymbolicRing._element_constructor_:

       elif hasattr(x, '_symbolic_'):
           return x._symbolic_(self)


Isn't that check for the _symbolic_ method redundant? Is there any reason for that check in _element_constructor_ to be there? I commented it out and it seems to work just fine.

Thanks---I'm just trying to understand the coercion model a bit better.

You're completely correct--the hasattr(x, '_symbolic_') is probably just a hold over from before the coercion overhaul (or an omission when SR was moved over to the new coercion model).

- Robert

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to