A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Extending types in C

[Python-Dev] Extending types in C - help neededJack Jansen Jack.Jansen@oratrix.nl
Thu, 17 Jan 2002 21:59:13 +0100
On Thursday, January 17, 2002, at 11:29  AM, M.-A. Lemburg wrote:

> Jack Jansen wrote:
>>
>> In the discussion on my request for an ("O@", typeobject,
>> void **) format for PyArg_Parse and Py_BuildValue MAL suggested
>
> Thomas Heller suggested this.

Oops, you're right. I should be careful not to mix up my Germans;-)

> I am more in favour of
> exposing the pickle reduce API through "O@", that is
> have PyArgTuple_Parse() call the .__reduce__() method
> of the object. This will then return (factory, state_tuple)
> and these could then be exposed to the C function via two
> PyObject*.

You've suggested this before, but at that time I ignored it 
because it made absolutely no sense to me. "pickle" triggers one 
set of ideas for me, "reduce" triggers a different set, "factory 
function" yet another different set. None of these sets of ideas 
have the least resemblance to what I'm trying to do:-)

I gave a fairly complete example (using calldll from Python to 
wrap a function that returns a Mac WindowObject) last week, 
could you explain how you would implement this with pickle, 
reduce and factory functions?
--
- 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