PS:

On 2012-08-15, Simon King <simon.k...@uni-jena.de> wrote:
> Alternatively, one could try to use the category framework in a nasty
> way: If "R in Fields()" returns True, then R.category() is refined to a
> sub-category of Fields(). In that way, is_Field(R) would only be called
> in the first instance of "R in Fields()", so that caching of is_Field
> isn't needed anymore, even if R.is_field() is not cached.

Hang on! The last few lines of is_Field say:
    _is_Field_cache[x] = result
    if result:
        x._refine_category_(_Fields)
    return result

Hence, the idea of refining the category is used already! But then,
there only remains to deprecate is_Field, and replace it by "R in
Fields()" everywhere in Sage.

That sounds like a clean solution - "R in Fields()" is pretty fast, if
R.category() is a sub-category of Fields().

Cheers,
Simon


-- 
-- 
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