#11900: Serious regression caused by #9138
----------------------------------------------------------------------------------------+
Reporter: SimonKing
| Owner: tbd
Type: defect
| Status: needs_work
Priority: critical
| Milestone: sage-4.8
Component: performance
| Keywords: categories regression
Work_issues: Laurent series rings are fields. Add docs. Don't use is_ring and
friends | Upstream: N/A
Reviewer: Jeroen Demeyer, Nicolas M. ThiƩry
| Author: Simon King
Merged:
| Dependencies: #9138 #11911
----------------------------------------------------------------------------------------+
Comment(by nthiery):
Replying to [comment:128 SimonKing]:
> Meanwhile I think raising an error would not hurt. Namely,
`__classcall__` can easily test whether the given class is anything that
is not a direct subclass of Category_singleton. Hence, subclassing Rings
will be illegal, and calling Category_singleton() will also be illegal.
And moreover, this test would only happen ''once'', namely before creating
the unique instance of the singleton. So, if will have no performance
penalty for `%timeit Rings()`.
>
> OK. I am now testing a patch version where `EnumeratedSets` is the only
singleton that is not implemented using `Category_singleton`.
+1 on both.
> > Especially since the copy can easily be done with something like:
> > {{{
> > class DeBruijnSequences
> > ...
> >
> > _call_ = EnumeratedSets.__dict__['_call_']
> > }}}
>
> Can it use a method of one class for another class that is not a
subclass?
Yup: unlike EnumeratedSets._call_, EnumeratedSets.__dict__['_call_']
is the original Python *function*, before it was transformed into a
method of EnumeratedSets. Not the nicest idiom on earth, but the trick
works ...
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11900#comment:129>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.