Ticket #12683 (new defect)
Inappropriate comparison of method
|Reported by:||culler||Owned by:||AlexGhitza|
|Component:||basic arithmetic||Keywords:||rich comparison|
sage: z = 3+4j sage: z.real < 0 True
It is very easy to encounter this when importing working python scripts into Sage. But it can be a bear to fix since there is no indication of any problem, other than wrong answers.
There is no meaningful sense in which the method z.real should be considered less than the number 0. So this comparison should return NotImplemented?. In fact, I would suggest that every comparison between a method and any other object should return NotImplemented?.