Option 2: the goal is to eventually eliminate ParentWithGens and
ParentWithBase, and rewrite all classes in Sage that use their functionality
to instead use the functions defined by sage.structure.parent.Parent and
sage.structure.category_object.CategoryObject.

This transition will take quite a bit of work.  We tried doing it all at
once at a Sage Days a year and a half ago and failed.  Instead, there's now
a framework set up to enable doing the transition gradually, one class at a
time.

The currently favored framework is described at
http://wiki.sagemath.org/coercion (more details can be obtained by looking
at the reference manual pages on sage/structure/parent.pyx,
sage/structure/coerce.pyx, sage/structure/coerce_actions.pyx,
sage/structure/coerce_maps.pyx).  Note that the provided methods described
there (__call__, get_action, has_coerce_map_from, etc), generally won't work
if you're inheriting from a parent that doesn't comply with the new system
(for example, it might define it's own __call__ method, making your
_element_constructor_ never be called).

The ticket setting up the transition framework is at
http://trac.sagemath.org/sage_trac/ticket/3738.  What I couldn't find just
by googling was a guide for converting old parents to the new style.  I
think that there are a number of people who could write such a document: if
you want to help me put it together, let me know.  The difficulty varies
quite a bit: most are going to be easy (with the obstruction mainly the
sheer number of changes to make), and some are trickier.

Once I have something that's coherent to people who aren't already familiar
with the coercion system, I'll put it on the wiki and e-mail the list.
David

On Fri, Feb 12, 2010 at 5:14 PM, Andrey Novoseltsev <novos...@gmail.com>wrote:

> Hello,
>
> I have started writing a class for Fano toric varieties, and as I
> understand it should inherit from AmbientSpace. Going further,
> AmbientSpace derives from ParentWithGens and in the beginning of the
> corresponding file we see
>
> .. note::
>
>   This class is being deprecated, see
>   ``sage.structure.parent.Parent`` and
>   ``sage.structure.category_object.CategoryObject`` for the new
>   model.
>
> Does it mean that all NEW classes in Sage have to derive from these
> ones, or the goal is also to eventually rewrite OLD classes derived
> from ParentWithGens to use the new model too? In particular, is it
> desirable to make AmbientSpace derived from Parent?
>
> Thank you,
> Andrey
>
> --
> 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<sage-devel%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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