On Fri, Feb 15, 2013 at 5:21 AM, Simon King <[email protected]> wrote:
> Hi!
>
> On 2013-02-15, Volker Braun <[email protected]> wrote:
>> And nothing lasts as long as a temporary quick fix ;-)
>
> Very true.
>
> But when I look at ParentWithGens itself, it seems to me fine.
> ParentWithBase seems almost fine, except for
>
>     cdef _coerce_c_impl(self,x):
>        check_old_coerce(self)
>        if not self._base is self:
>            return self._coerce_try(x,(self._base))
>        else:
>            raise TypeError, "No canonical coercion found."
>
> where self._coerce_try is not defined in this file. But since coercion
> is supposed to be provided in a different way anyway (in the new
> coercion model), one could just include a deprecation warning, and see
> what classes actually call the old _coerce_c_impl. In this way, one
> could assess how much work is needed to be done.

It'd be a good idea to install some hooks/deprecation warnings to see
what remains to be done, but the goal of check_old_coerce is to make
these methods inaccessible to classes claiming to use the new coercion
model.

> Concerning parent_old.Parent, I notice that the __init__ method only
> does things that would make sense to be done in parent.Parent.__init__
> as well. In particular, it call _set_element_constructor, which is
> defined in parent.Parent anyway.
>
> Strangely parent_old.Parent.__init__ does not call
> parent.Parent.__init__. That's why rings.ring.Ring.__init__ calls
> parent.Parent.__init__ directly. And of course, parent_old.Parent has a
> lot of methods that belong to the old coercion model.
>
> But would it seem so hopeless to try and merge parent_old.Parent and
> parent.Parent into one class?

No! parent_old.Parent is the set of things that we want to delete.
It's an adapter to things that used the old model(s) to co-operate
with the new.

Essentially, everything in parent_old, parent_gens, and parent_base
should go away. All their methods are (or should be) guarded by
check_old_coerce() so that their functionality is never used by
anything in the new coercion model. We can't remove it now as some
stuff still uses it, but we shouldn't copy this crufty mess somewhere
more permanent (without a compelling reason and further discussion at
least).

- Robert

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to