Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107459 > unrolled thread

How are you supposed to define subclasses in C?

Started byRandom832 <random832@fastmail.com>
First post2016-04-21 12:35 -0400
Last post2016-04-21 12:35 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  How are you supposed to define subclasses in C? Random832 <random832@fastmail.com> - 2016-04-21 12:35 -0400

#107459 — How are you supposed to define subclasses in C?

FromRandom832 <random832@fastmail.com>
Date2016-04-21 12:35 -0400
SubjectHow are you supposed to define subclasses in C?
Message-ID<mailman.20.1461256559.23626.python-list@python.org>
I was trying to write a proof of concept on including descriptors (e.g.
a "sys.recursionlimit" instead of set/get methods) in the sys module,
and couldn't figure out how to "properly" define a type using
PyType_FromSpecWithBases. Everything I tried just segfaulted. I ended up
just calling PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, ...)
but I assume there's a better way to do it. I couldn't find any examples
or tutorial.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web