#17670: Get rid of hook_tp_functions() hack
----------------------------------+------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.5
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
----------------------------------+------------------------
Description changed by jdemeyer:
Old description:
> The classes `integer.pyx` and `real_double.pyx` use `hook_tp_functions()`
> to change `tp_new` and `tp_dealloc` at run-time. With Cython, such hacks
> are not needed: one can just define `__new__` and `__dealloc__` and
> things should "just work".
>
> Some hackery is still needed because these types also disable garbage
> collection by changing `tp_flags` and there is no clean Cython interface
> to do this.
New description:
The classes `integer.pyx` and `real_double.pyx` use `hook_tp_functions()`
to change `tp_new` and `tp_dealloc` at run-time. With Cython, such hacks
are not needed: one can just define `__new__` and `__dealloc__` and things
should "just work".
Since this custom `__new__` and `__dealloc__` are used to implement an
object pool, it's better to make a new class to implement such pools.
Some hackery is still needed because these types also disable garbage
collection by changing `tp_flags` and there is no clean Cython interface
to do this.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/17670#comment:1>
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 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-trac.
For more options, visit https://groups.google.com/d/optout.