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?
Asked
Active
Viewed 1,919 times
1
-
2No official limit. Any implementation limits are implementation details. – user2357112 Mar 10 '20 at 23:18
-
2Does 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
-
2Interested in why you're interested. – jarmod Mar 10 '20 at 23:20
-
1No 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
-
1PEP8: 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 Answers
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
-
1Link to python 3 [docs](https://docs.python.org/3/reference/lexical_analysis.html#identifiers). – AKS Mar 11 '20 at 05:09
-