Skip to content

New check: use yield from #9229

@nickdrozd

Description

@nickdrozd

Current problem

Yielding item by item from a generator:

for item in generator:
    yield item

Desired solution

It is cleaner and maybe even a little faster to use yield from:

yield from generator

This should be an easy check to implement.

Additional context

Note that yield from does a lot more than just iterate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentGood first issueFriendly and approachable by new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions