Serhiy Storchaka added the comment:

Currently it is not possible to declare a Python function with more than 255 
parameters. There were two historical causes of this:

1. Opcodes MAKE_FUNCTION and MAKE_CLOSURE packed the number of default values 
for positional and keyword parameters in the opcode argument as 8-bit numbers.

2. co_cell2arg was of type "unsigned char *". It's mapped a cell index to an 
argument index and didn't support arguments with index > 254.

The first limitation is disappeared in 3.6 after changing the format of 
MAKE_FUNCTION (issue27095). Proposed patch gets rid of the second cause by 
changing the type of co_cell2arg and removes explicit check in the compiler.

----------
components: +Interpreter Core
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 3.7 -Python 3.4
Added file: http://bugs.python.org/file45667/no-params-limit.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18896>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to