Re: [Python-Dev] The curious case of 255 function arguments

2018-08-07 Thread Stephen McDowell
Hi Andrea and Serhiy, Thank you for your responses and clarifying that it is specifically the CALL_FUNCTION. I tested this in my megascript and it will fail when trying to call the functions directly and receive an error then (Py 2.x: fail at call invocation, Py 3.y w/ y<7: fail at function defin

Re: [Python-Dev] The curious case of 255 function arguments

2018-08-06 Thread Serhiy Storchaka
06.08.18 08:13, Stephen McDowell пише: I've looked at the C code for a while and it is entirely non-obvious what would lead to python *2* /allowing/ >255 arguments.  Anybody happen to know how / why the python *2* versions *succeed*? The error message is misleading. It should be "more than 255

Re: [Python-Dev] The curious case of 255 function arguments

2018-08-06 Thread Andrea Griffini
typo... meant of course foo(*([0]*300)) Andrea On Mon, Aug 6, 2018 at 9:57 AM Andrea Griffini wrote: > With Python 2.7.15 what fails is a call with explicit arguments (e.g. > `foo(0,0,0 ... 0,0)`), not the function definition. > Calling with `foo([0]*300)` instead works. > > > On Mon, Aug 6, 20

Re: [Python-Dev] The curious case of 255 function arguments

2018-08-06 Thread Andrea Griffini
With Python 2.7.15 what fails is a call with explicit arguments (e.g. `foo(0,0,0 ... 0,0)`), not the function definition. Calling with `foo([0]*300)` instead works. On Mon, Aug 6, 2018 at 7:18 AM Stephen McDowell wrote: > Hello Python Gurus, > > TL;DR: 3.7 released functions having greater than

[Python-Dev] The curious case of 255 function arguments

2018-08-05 Thread Stephen McDowell
Hello Python Gurus, TL;DR: 3.7 released functions having greater than 255 arguments. Despite explicit checks for this in 2.x, no such limit is actually imposed -- why? In the 3.7 release notes "Other Language Changes" section ( https://docs.python.org/3.7/whatsnew/3.7.html#other-language-changes