تخطَّ إلى المحتوى

Function name snake_case (ARCH2002)

هذا المحتوى غير متوفر بلغتك بعد.

Key python.naming.function-name-snakecase · Severity warning · Category naming

PEP-8 requires function and method names to use snake_case. camelCase or PascalCase function names deviate from the Python convention and hurt readability.

def CalculateTotal(items):
return sum(items)
def calculate_total(items):
return sum(items)

Rename functions and methods to snake_case (e.g. CalculateTotal → calculate_total).