Since Robert is probably pretty busy, I'll answer this. I don't know how much documentation exists for this yet.
You should override _element_constructor_ on parent and not any of the others. For methods in the coercion system, you generally want to override the method name with single underscores on each side (e.g. _coerce_map_from_). __call__ does various things before calling the element constructor: trying canonical coercion, etc. I think that element_constructor is the keyword passed up to various methods on Parent, like populate_coercion_lists, but isn't actually a method or attribute. _element_constructor is an attribute of parent. It may be reasonable to write to it directly, but it's better to override _element_constructor_. David On Thu, Jan 29, 2009 at 8:09 PM, Florent Hivert < florent.hiv...@univ-rouen.fr> wrote: > > Dear All and probably mostly Robert Bradshaw, > > I'm trying to complete Nicolas infrastructure for categories and I don't > understand the design of the standard mechanism for building elements. > Mainly, > my problem is: for a parent P, are there precise specifications concerning > the > respective roles of > __call__ > element_constructor > _element_constructor > _element_constructor_ > Any answer or pointer to some documentation is most welcome. > > Best regards, > > Florent > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---