Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:python-best-practices/condition-similar-block
Language: Python
Severity: Warning
Category: Best Practices
Description
Code in the branches of an if condition must be unique. If you have duplicated branches, merge the conditions.
Non-Compliant Code Examples
iffoo:printf("bar")elifbaz:printf("bar2")elifbap:# same code than the if conditionprintf("bar")else:# same code than the if conditionprintf("bar")