High Python

Use context managers for resources

Rule Description

with statement for files, connections, locks. contextlib for custom managers. Never leave resources open. async with for async resources.

Included in Rulesets

Django Best Practices
56 rules • 1 standard
View
FastAPI Guidelines
56 rules • 1 standard
View
Python Standards
56 rules • 2 standards
View
Code Review Standards
214 rules • 0 standards
View

Add This Rule

Sign in to add this rule to your workspace

Sign in with GitHub

Details

Severity
High
Category
Python
Used in
4 rulesets