This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Public Generator Object/Type
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: jwpye, loewis
Priority: high Keywords: patch

Created on 2004-05-20 13:59 by jwpye, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pubgen.diff jwpye, 2004-05-20 15:43 This patches concrete.tex, ceval.[ch], Makefile.pre.in
genobject.c jwpye, 2004-05-20 15:43
genobject.h jwpye, 2004-05-20 15:44
Messages (5)
msg46026 - (view) Author: James William Pye (jwpye) Date: 2004-05-20 13:59
Here the patches/files for public generator object/type.
removal patch for ceval.c
msg46027 - (view) Author: James William Pye (jwpye) Date: 2004-05-20 16:09
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...)
msg46028 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-05-31 18:30
Logged In: YES 
user_id=21627

What is the purpose of this patch?
msg46029 - (view) Author: James William Pye (jwpye) Date: 2004-05-31 19:39
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.
msg46030 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-06-01 16:33
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as

Makefile.pre.in 1.143
concrete.tex 1.40
ceval.h 2.51
genobject.h 2.1
NEWS 1.981
genobject.c 1.1
ceval.c 2.397
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40276
2004-05-20 13:59:31jwpyecreate