Skip to content
Back to skills

Python Generators Coroutines

ASecurity

Use when implementing Python generators and coroutines.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
ai-agentspythonexpress

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill python-generators-coroutines --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Generators Coroutines?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Generators Coroutines
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-python-generators-coroutines/badge)](https://www.skillsdirectory.com/skills/loopyluci-python-generators-coroutines)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-generators-coroutines
description: "Use when implementing Python generators and coroutines."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [python, generators, yield, coroutines, send, yield-from]
    related_skills: [python-async-patterns, python-decorators-advanced, data-pipeline-streaming]
---

# Python Generators and Coroutines

Implementing Python generators — from generator expressions through yield from, send/throw/close, and bidirectional coroutines.

## When to Use

- Processing data streams with generator pipelines
- Implementing coroutines for cooperative multitasking
- Lazy evaluation and infinite sequences
- Data pipeline composition

## Generator Patterns

```python
def pipeline(*steps):
    """Chain generator functions."""
    def run(initial):
        result = initial
        for step in steps:
            result = step(result)
        return result
    return run

def read_chunks(file, size=8192):
    while True:
        chunk = file.read(size)
        if not chunk: break
        yield chunk

def grep(pattern):
    """Bidirectional coroutine generator."""
    while line := (yield):
        if pattern in line:
            yield line
```

## Verification Checklist

- [ ] Generator expressions vs list comprehensions
- [ ] yield from for subgenerator delegation
- [ ] .send() for bidirectional communication
- [ ] Generator pipeline composition
- [ ] Memory-efficient large data processing

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.