A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-January/019609.html below:

[Python-Dev] Extending types in C

[Python-Dev] Extending types in C - help neededJack Jansen Jack.Jansen@oratrix.nl
Sat, 19 Jan 2002 01:07:56 +0100
On Friday, January 18, 2002, at 08:36  PM, Martin v. Loewis wrote:

>> Also, the method seems rather complicated for doing a simple 
>> thing. The
>> only thing I really want is a way to refer to an _New or 
>> _Convert method
>> from Python code.
>
> I believe the attached code implements your requirements.
>

Martin, hats off!

This does exactly what I want, and it does so in a pretty 
generalized way. Actually in _such_ a generalized way that I 
think this should be documented loud and clear.

Looking at it a bit more, how about storing each function 
pointer in a separate PyCObject, and adding general APIs 
somewhere in the core
void PyType_SetAnnotation(PyTypeObject *tp, char *name, char 
*descr, void *);
void *PyType_GetAnnotation(PyTypeObject *tp, char *name, char *descr);

(I've picked the name annotation here, because it sort-of feels 
like that, another name may bring the idea across better).
> --
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4