What is the maximum length for an attribute name in python?

后端 未结 3 1475
面向向阳花
面向向阳花 2021-01-11 08:55

I\'m writing a set of python functions that perform some sort of conformance checking on a source code project. I\'d like to specify quite verbose names for these functions,

3条回答
  •  无人及你
    2021-01-11 09:41

    2.3. Identifiers and keywords from The Python Language Reference:

    Identifiers are unlimited in length.


    But you'll be violating PEP-8 most likely, which is not really cool:

    Limit all lines to a maximum of 79 characters.

    Also you'll be violating PEP-20 (the Zen of Python):

    Readability counts.

提交回复
热议问题