Skip to content

inspect.isgenerator is broken #997

Closed
@smurfix

Description

@smurfix

This doesn't quite match what I'd expect.

MicroPython v1.24.0-400.g160c2931f.dirty on 2025-04-10; linux [GCC 14.2.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> async def fn():
...     pass
...
>>> x=fn()
>>> inspect.isgeneratorfunction(x)
False  ## correct
>>> inspect.isgenerator(x)
False  ## wrong
>>> x
<generator object 'fn' at 7f5b2a9534a0>
>>> inspect.isgeneratorfunction(fn)
True  ## correct
>>> inspect.isgenerator(fn)
True  ## wrong
>>> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions