Context Managers for Bioinformatics
Lifecycle
with ctx as resource:
__enter__() → acquire
(body)
__exit__() → release (always runs, even on exception)
__exit__(exc_type, exc_val, tb) — return True to suppress the exception, False/None to re-raise.
Class-Based Context Manager
class FastaWriter:
def __init__(self, filename: str, line_width: int = 80):
self.filename = filename
self.line_width = line_width
self.file = Non
[Description truncada. Veja o README completo no GitHub.]