Chris Jerdonek <chris.jerdo...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue15457>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to