[issue15457] consistent treatment of generator terminology

Chris Jerdonek report at bugs.python.org
Sat Jul 28 09:26:28 CEST 2012


Chris Jerdonek <chris.jerdonek at gmail.com> added the comment:

I created issue 15476 to add "code object" to the glossary.

> Generator functions must have a special __call__ method that simply creates and returns a generator instance with the code object attached (instead of executing the code).

Just to be sure, is this the same as what you were saying in your previous comment?

"The gf does this# by setting the gi_code attribute of instances to the code object compiled from its body. (Or perhaps it calls the generator class with its code object as parameter. In any case, this is what the special gf.__call__ method does instead of executing its code attribute."

Since you're not sure whether the gi_code attribute is meant to be public, it may be best not to mention it explicitly in the docs.  This is consistent with what I have done in the latest patch.  Thanks in advance for reviewing the update.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15457>
_______________________________________


More information about the Python-bugs-list mailing list