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/2006-May/065410.html below:

[Python-Dev] feature request: inspect.isgenerator

[Python-Dev] feature request: inspect.isgenerator [Python-Dev] feature request: inspect.isgeneratorNeal Norwitz nnorwitz at gmail.com
Tue May 30 06:48:00 CEST 2006
On 5/29/06, Georg Brandl <g.brandl at gmx.net> wrote:
> Fredrik Lundh wrote:
> >
> > is there some natural and obvious connection between generators and that
> > number that I'm missing, or is that constant perhaps best hidden inside
> > some introspection support module?
>
> It seems to be a combination of CO_NOFREE, CO_GENERATOR, CO_OPTIMIZED and
> CO_NEWLOCALS.
>
> The first four CO_ constants are already in inspect.py, the newer ones
> (like CO_GENERATOR) aren't.

All these constants are declared in compiler.consts.  Some are also
defined in __future__.  It would be better to have them all in a
single place.

> I wonder whether a check shouldn't just return (co_flags & 0x20), which
> is CO_GENERATOR.

Makes more sense.

n
More information about the Python-Dev mailing list

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