[Patches] [ python-Patches-957398 ] Public Generator Object/Type

SourceForge.net noreply at sourceforge.net
Mon May 31 15:50:33 EDT 2004


Patches item #957398, was opened at 2004-05-20 15:59
Message generated for change (Settings changed) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=957398&group_id=5470

Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
>Priority: 6
Submitted By: James William Pye (jwpye)
>Assigned to: Martin v. Löwis (loewis)
Summary: Public Generator Object/Type

Initial Comment:
Here the patches/files for public generator object/type.
removal patch for ceval.c

----------------------------------------------------------------------

Comment By: James William Pye (jwpye)
Date: 2004-05-31 21:39

Message:
Logged In: YES 
user_id=1044177

Externalize the generator type so that it can be easily
accessed/referenced by extension mod authors and embedders..

http://mail.python.org/pipermail/python-dev/2004-May/044742.html


I would use it, as an embedder, in my postgresql extension:
http://gborg.postgresql.org/project/postgrespy/projdisplay.php

Currently, I compile a little generator and snag the
type(this is the same thing as from types import
GeneratorType, I suppose), and will do so if I don't have
direct access. I also access parts of the generator,
currently using getattr, but if I had access to it, I would
do it directly.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2004-05-31 20:30

Message:
Logged In: YES 
user_id=21627

What is the purpose of this patch?

----------------------------------------------------------------------

Comment By: James William Pye (jwpye)
Date: 2004-05-20 18:09

Message:
Logged In: YES 
user_id=1044177

Ok, got it to compile, and tried out a simple generator;
seems to be fine..

Probably should have asked first, but I'm assuming(yay) that
it was desired to draw it inline with *object.[ch]
organization protocol..

Only gotcha appears to be that genobject.c, of course,
references eval_frame, so I just wrapped a call to it in
eval.c with a non-static function(PyEval_EvaluateFrame()),
this is probably not be what python-dev would like.. I
mostly did it like this to get it to compile.(probably a bad
idea, and should probably reference it directly. no need for
an extra layer of function call overhead...)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=957398&group_id=5470



More information about the Patches mailing list