2

What is meaning of this rule? 1.mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

Suryansh
  • 21
  • 1
  • 4
    Look at [PEP 8](https://www.python.org/dev/peps/pep-0008/#function-and-variable-names) and [related question](https://stackoverflow.com/questions/159720/what-is-the-naming-convention-in-python-for-variable-and-function-names?rq=1) – 12944qwerty May 02 '21 at 15:56

1 Answers1

3

mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility

It means exactly what is says. Function names should only be mixed case - like doThing or computeAmount if that style is already in use in the containing module, of which threading.py is an example.

This is to cater for modules which were written before PEP8.

In any modern Python code you should use snake_case for function and variable names.

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153