#12808: Optimize ClassCallMetaClass using Cython
--------------------------------------------------+-------------------------
Reporter: hivert | Owner: jason
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.0
Component: misc | Resolution:
Keywords: classcall UniqueRepresentation | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------+-------------------------
Comment (by SimonKing):
Replying to [comment:21 hivert]:
> > Why is `__all__ = ['ClasscallType', 'ClasscallMetaclass', 'typecall',
'timeCall']` added? Isn't importing also possible without that? Or is it
needed to make `from sage.misc.classcall_metaclass import *` work?
>
> I just want to hide the few class I wrote here for timing (CRef, C2, C3,
> C2C). With this line, they are neither imported with import *, nor
documented.
So, it is not for making something importable, but for ''excluding''
something from automatic import? Cool!
> > Why is there a two-step cythonisation?
>
> There is this discussion about cleaning up the way metaclass are defined
and
> used in Sage.
You mean the [http://groups.google.com/group/sage-combinat-
devel/browse_thread/thread/ae09de5a608525e5 sage-combinat-devel] thread I
started?
> I just wanted to keep features separate.
Well, I actually think cythoning `NestedClassMetaclass` is ''less''
intrusive than your patch.
Compare: You have to ''add'' a new cdef class `ClasscallType` and change
the inheritance of `ClasscallMetaclass`. I suggest to change
`NestedClassMetaclass` into a cdef class, keep the inheritance of
`ClasscallMetaclass`, and avoid the addition of `ClasscallType`.
I think I will test it...
> You mean `cpdef inline` (we may want to call it from Python) ?
Yes, I forgot the letter "p".
> I had the
> impression from C that this inline doesn't do anything if the function
is
> defined in a different module. More precisely, in C/C++ inline only work
if
> the function is defined in {{{.h}}} instead of {{{.c}}}. Does Cython do
> anything for that ?
I expected it to be inlined, if it is defined cpdef inline in the pxd
file, and then cimported into another cython file. But I don't know if
that is really done, actually.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12808#comment:23>
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.