开发者

What is the maximum length of a character function argument in jython?

What is the maximum length of a character function argument in python/jython?

I've reviewed the documentation on python.org and n开发者_C百科o 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜