On Monday, 28 April 2025 at 12:56:36 UTC-7 dim...@gmail.com wrote:

this is from https://github.com/sagemath/sage/pull/35119

a part of a push towards namespace packages to certainly ill-conceived 
modularization project.

 
I don't think the origin of the change is so relevant (other than the 
reputational damage people incur from having buggy code accepted in 
sagemath but that's more a cautionary tale for individual contributors to 
properly review their own work).  I think it's more of a wake-up call for 
our code quality review process. The deprecation remark suggests a 
statement that is not at all equivalent to the code that's there:

from sage.rings.finite_rings.finite_field_base import is_FiniteField
return isinstance(x, Element) and is_FiniteField(x.parent())

Most of these "is_*" routines used to be isinstance checks (as this one is 
mainly too). The tricky bit here is that it says "Element" and not 
"FieldElement". That's a big gotcha indeed. One would expect field elements 
to inherit from FieldElement and for finite fields that's not what happens. 
Wasn't the category framework supposed to fix such things? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/92d4821f-c6f4-45cf-89ac-3863a8761cb5n%40googlegroups.com.

Reply via email to