What is the maximum length of a character function argument in python/jython?
I've reviewed the documentation on python.org and no luck
What is the maximum length of a character function argument in python/jython?
I've reviewed the documentation on python.org and no luck
Python passes function arguments by reference, so the maximum length of a string passed to a function is purely dependent on the maximum length of a string.
It so happens that the maximum length of a string is platform dependent (Address space and/or RAM, generally) - see the question What is the max length of a Python string for details.
In python (and I'd assume this would work in jython as well) you can find out this value with sys.maxsize
:
>>>import sys
>>>print sys.maxsize
9223372036854775807
From the docs:
maxsize: The largest positive integer supported by the platform’s Py_ssize_t type, and thus the maximum size lists, strings, dicts, and many other containers can have.
Your max length string will not be anywhere near this many characters, mind you.