#4190: [with patch, with positive review and a question] division of number 
field
order elements doesn't check for membership
---------------------------+------------------------------------------------
 Reporter:  davidloeffler  |        Owner:  davidloeffler
     Type:  defect         |       Status:  assigned     
 Priority:  major          |    Milestone:  sage-3.2.1   
Component:  number theory  |   Resolution:               
 Keywords:                 |  
---------------------------+------------------------------------------------
Comment (by cremona):

 Replying to [comment:10 davidloeffler]:
 > As for the inheritance thing: unfortunately, OrderElement_relative,
 OrderElement_absolute and OrderElement_quadratic all inherit from the
 corresponding number field classes, which all have different _ div _
 implementations, and multiple inheritance is banned. So there is no one
 place we can put the method where it will be inherited by everything.
 Personally I'm not sure I agree on that design decision, but I don't have
 the skills or the time to reimplement it otherwise.

 OK, too bad.

 >
 > As far as I can tell, the "a in OK" is calling some very generic code
 (probably in sage.structure.Parent at a guess) which checks whether or not
 a.parent() is OK, and if it isn't, attempts to coerce a into OK via OK's
 __ call __ method, returning False if this fails.

 You are right.  In fact one way to see where this is happening is to try
 OK(1/a) (where 1/a is not in OK) and see where the TypeError comes from,
 in this case order.py, in OK's {{{__call__}}} function.

 >
 > I am in India at the moment and it is late evening local time; I will
 get to work on improving the doctests tomorrow.

 No hurry.  If you had time to look at #4392, even better!

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4190#comment:11>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to