255 argument limit?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Yanowitz

    255 argument limit?

    Hello:

    It appears that there is a 255 argument limit in Python 2.4.3?
    >>packed_data = struct.pack("26 0i",
    0,1,2,3,4,5,6,7 ,8,9,10,11,12,1 3,14,15,16,17,1 8,19,20,21
    ,22,23,24,25,26 ,27,28,29,30,31 ,32,33,34,35,36 ,37,38,39,40,41 ,42,43,44,45,46 ,
    47,4
    8,49,50,1,1,1,1 ,1,1,1,1,1,60,1 ,2,3,4,5,6,7,8, 9,70,1,2,3,4,5, 6,7,8,9,80,1,2, 3
    ,4,5
    ,6,7,8,9,90,1,2 ,3,4,5,6,7,8,9, 100,1,2,3,4,5,6 ,7,8,9,110,1,2, 3,4,5,6,7,8,9,1 2
    0,1,
    2,3,4,5,6,7,8,9 ,130,1,2,3,4,5, 6,7,8,9,140,1,2 ,3,4,5,6,7,8,9, 150,1,2,3,4,5,6 ,
    7,8,
    9,160,1,2,3,4,5 ,6,7,8,9,170,1, 2,3,4,5,6,7,8,9 ,180,1,2,3,4,5, 6,7,8,9,190,1,2 ,
    3,4,
    5,6,7,8,9,200,1 ,2,3,4,5,6,7,8, 9,210,1,2,3,4,5 ,6,7,8,9,220,1, 2,3,4,5,6,7,8,9 ,
    230,
    1,2,3,4,5,6,7,8 ,9,240,1,2,3,4, 5,6,7,8,9,250,1 ,2,3,4,5,6,7,8, 9)
    SyntaxError: more than 255 arguments

    Is there a way to increase this limit?
    (This is just a made up example, I would not normally do this).

    Thanks in advance:
    Michael Yanowitz


  • yairchu@gmail.com

    #2
    Re: 255 argument limit?

    >
    It appears that there is a 255 argument limit in Python 2.4.3?
    >
    maybe the argument limit is for the sake of not making functions too
    complicated.
    if your function takes more than 200 arguments it can probably go to
    thedailywtf.com ,
    better be strict like i am and even avoid making a 100 arguments
    function.

    :)

    Comment

    Working...