1

Every length seems to work, as long as I conform to the rules of defining the function name. What exactly is the limit or is there even one?

jarmod
  • 71,565
  • 16
  • 115
  • 122
codewin
  • 41
  • 1
  • 9
  • 2
    No official limit. Any implementation limits are implementation details. – user2357112 Mar 10 '20 at 23:18
  • 2
    Does this answer your question? [What is the maximum length for an attribute name in python?](https://stackoverflow.com/questions/16920835/what-is-the-maximum-length-for-an-attribute-name-in-python) – PacketLoss Mar 10 '20 at 23:19
  • 2
    Interested in why you're interested. – jarmod Mar 10 '20 at 23:20
  • 1
    No there are no limits on the length, but there are style guides to follow. Still it is up to you on how you will name your functions in your code. – Errol Mar 10 '20 at 23:23
  • 1
    PEP8: Limit all lines to a maximum of 79 characters. Not one of the favorite PEP guidelines, of course. – jarmod Mar 10 '20 at 23:25

1 Answers1

8

https://docs.python.org/3/reference/lexical_analysis.html#identifiers

They are unlimited. However lines longer than 79 characters violate pep style guides.

David Stein
  • 379
  • 2
  • 15