question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow cdef class inheritance from builtin exception types

See original GitHub issue

In all supported CPython versions (Py2.6+), exceptions are implemented as builtin types. It would be nice to allow users to inherit from them in cdef classes, i.e. to directly support

cdef class MyException(Exception):
    cdef int error_info

Migrated from http://trac.cython.org/ticket/862

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
robertwbcommented, Oct 1, 2016

And fully fixed at b1d7b0de9e4cdc1eb866661e34f3da8892993fba.

0reactions
jdemeyercommented, Jan 28, 2019

Any reason that this was only done for Exception and not other classes like ValueError?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extension types (aka. cdef classes) - Cython's Documentation
Cython requires to know the complete inheritance hierarchy in order to lay out their C structs, and restricts it to single inheritance.
Read more >
Extension Types — Cython 0.21 documentation
You define an extension type using the cdef class statement. ... An extension type may inherit from a built-in type or another extension...
Read more >
Extension Types
You define an extension type using the cdef class statement. ... An extension type may inherit from a built-in type or another extension...
Read more >
Calling Cython from c++ with not built-in types - Stack Overflow
To create a Cython extension class from existing C++ pointer, use a factory function. For example: cdef class PyMyClass: cdef MyClass ...
Read more >
Calling type to construct an object - Google Groups
a new instance of C. The solution is to have a metaclass inheriting from type ... ctypedef class __builtin__.type [object PyHeapTypeObject]: pass. cdef...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found