Hi Stefan,
On 24 Apr., 12:39, Stefan Behnel <
stefan...@behnel.de> wrote:
> Did you notice that you didn't call the supertype's __init__() in your
> first example? Not sure if it matters - just occurred to me.
Yes, I noticed, and no, calling it does not help.
Actually in the current code in
sage.misc.nested_class.py,
type.__init__ it is not called either.
Let's try in meta.pyx:
cdef class CyMetaclass(type):
cdef class CyMetaclass(type):
def __init__(cls, *args, **opts):
print cls.__name__
type.__init__(cls, *args, **opts)
class PyMetaclass(type):
def __init__(cls, *args):
print cls.__name__
In a Sage session:
sage: attach meta.pyx
Compiling ./meta.pyx...
sage: class A(object):
....: __metaclass__ = CyMetaclass
....:
/home/simon/SAGE/sage-5.0.beta7/local/lib/libcsage.so(print_backtrace
+0x31)[0x7f2b4b8ff966]
/home/simon/SAGE/sage-5.0.beta7/local/lib/libcsage.so(sigdie+0x14)
[0x7f2b4b8ff998]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libcsage.so(sage_signal_handler+0x20c)[0x7f2b4b8ff5e6]
/lib64/libpthread.so.0(+0xfd00)[0x7f2b50be8d00]
/home/simon/SAGE/sage-5.0.beta7/local/lib/libpython2.7.so.1.0(+0xa6ff7)
[0x7f2b50e9cff7]
/home/simon/.sage//temp/linux_sqwp.site/4043//spyx//
_home_simon_SAGE_tests_meta_pyx/
_home_simon_SAGE_tests_meta_pyx_0.so(+0x23c8)[0x7f2b228c53c8]
/home/simon/SAGE/sage-5.0.beta7/local/lib/libpython2.7.so.1.0(+0xaaba8)
[0x7f2b50ea0ba8]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyObject_Call+0x53)[0x7f2b50e43823]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyObject_CallFunctionObjArgs+0xb0)[0x7f2b50e44110]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x1dcb)[0x7f2b50ee3b9b]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCode+0x32)[0x7f2b50ee8e82]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x57bf)[0x7f2b50ee758f]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x51f1)[0x7f2b50ee6fc1]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x51f1)[0x7f2b50ee6fc1]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x5dc1)[0x7f2b50ee7b91]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x51f1)[0x7f2b50ee6fc1]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x51f1)[0x7f2b50ee6fc1]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalFrameEx+0x51f1)[0x7f2b50ee6fc1]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCodeEx+0x855)[0x7f2b50ee8d45]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyEval_EvalCode+0x32)[0x7f2b50ee8e82]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyRun_FileExFlags+0xb0)[0x7f2b50f0b3c0]
/home/simon/SAGE/sage-5.0.beta7/local/lib/
libpython2.7.so.
1.0(PyRun_SimpleFileExFlags+0xdf)[0x7f2b50f0be5f]
/home/simon/SAGE/sage-5.0.beta7/local/lib/libpython2.7.so.1.0(Py_Main
+0xb6b)[0x7f2b50f1ea6b]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7f2b5020c23d]
python[0x4006c1]
------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a
bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------
/home/simon/SAGE/sage-5.0.beta7/spkg/bin/sage: Zeile 308: 4043
Speicherzugriffsfehler sage-ipython "$@" -i
Best regards,
Simon