Use naming conventions that are both tooling-correct and behavior-semantic:
is_* has side effects, it violates reader expectations. Either rename (e.g., maybe_unlock) or refactor to keep is_* side-effect-free.greenlet over gt).Example patterns to follow:
# Tooling-sensitive: matches `python_classes = "test_*"`
class test_pool_acquire_timeout:
...
# Semantic clarity: numeric timeout vs class
def apply_target(..., timeout=None, TimeoutClass=None, ...):
...
# Misleading name fix: keep `is_*` side-effect free
def is_locked(self):
return os.path.exists(self.path)
def maybe_unlock(self):
if self._is_stale():
self.remove_if_stale()
If you’re unsure, pick the name that answers “what is it?” and “what does it do?” without consulting the implementation.
Enter the URL of a public GitHub repository