max length of a python program

Discussion in 'Python' started by Ragu, Aug 21, 2003.

  1. Ragu

    Ragu Guest

    Is there a limit to the # of lines that can be in a Python program?

    cheers
    -Ragu
    Ragu, Aug 21, 2003
    #1
    1. Advertising

  2. Ragu wrote:
    > Is there a limit to the # of lines that can be in a Python program?


    The free version from python.org is limited to 500 lines per module.
    I'll gladly sell you Python Enterprise 2003, which has no lines of code
    limits at all and where code size is only limited by available memory.

    The current price is EUR 250 per seat or EUR 5000 for a site-license.
    One year of free support via Usenet (comp.lang.python) is included.

    -- Gerhard
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Aug 21, 2003
    #2
    1. Advertising

  3. Ragu wrote:

    > Is there a limit to the # of lines that can be in a Python program?


    No AFAIK.
    The only limitation is the common sense, nobody wants to drown into comments
    :)

    --
    Lawrence "Rhymes" Oluyede
    http://loluyede.blogspot.com
    Lawrence Oluyede, Aug 21, 2003
    #3
  4. (Ragu) writes:

    > Is there a limit to the # of lines that can be in a Python program?


    I can't seem to find one, although trying to run a million line file
    got the OOM killer into action...


    Cheers,
    mwh
    --
    ZAPHOD: OK, so ten out of ten for style, but minus several million
    for good thinking, eh?
    -- The Hitch-Hikers Guide to the Galaxy, Episode 2
    Michael Hudson, Aug 21, 2003
    #4
  5. Ragu

    Andrew Dalke Guest

    Ragu:
    > Is there a limit to the # of lines that can be in a Python program?


    Many years ago there was a limit of 64K lines, because of how
    the line number opcode worked in Python. Only machine
    generated Python code ever ran into that limit.

    That limit was removed in .. 1.5? Can't find mention of
    the fix in my cursory search.

    So no, no effective limit.

    Andrew
    Andrew Dalke, Aug 21, 2003
    #5
  6. Ragu

    Paul Watson Guest

    "Lawrence Oluyede" <> wrote in message
    news:bi2lbm$3v6fr$-berlin.de...
    > Ragu wrote:
    >
    > > Is there a limit to the # of lines that can be in a Python program?

    >
    > No AFAIK.
    > The only limitation is the common sense, nobody wants to drown into

    comments
    > :)
    >
    > --
    > Lawrence "Rhymes" Oluyede
    > http://loluyede.blogspot.com
    >


    Probably no fear of drowning in comments. It seems that many peole who
    write seemingly excesslively long source code files do not want to waste
    disk space or processing time on something so useless as comments.
    Paul Watson, Aug 21, 2003
    #6
  7. On Thu, 21 Aug 2003 15:22:30 +0200, rumours say that Gerhard Häring
    <> might have written:

    >Ragu wrote:
    >> Is there a limit to the # of lines that can be in a Python program?

    >
    >The free version from python.org is limited to 500 lines per module.
    >I'll gladly sell you Python Enterprise 2003, which has no lines of code
    >limits at all and where code size is only limited by available memory.
    >
    >The current price is EUR 250 per seat or EUR 5000 for a site-license.
    >One year of free support via Usenet (comp.lang.python) is included.


    Really? A few years ago, when I bought Python for the first time, the
    entry price I paid was my right hand and rights on my firstborn. Things
    have changed...

    Microsoft Python: bringing innovation to higher levels at a friendly
    price.
    --
    TZOTZIOY, I speak England very best,
    Microsoft Security Alert: the Matrix began as open source.
    Christos TZOTZIOY Georgiou, Aug 22, 2003
    #7
  8. Christos "TZOTZIOY" Georgiou <> writes:

    > On Thu, 21 Aug 2003 17:25:51 GMT, rumours say that "Andrew Dalke"
    > <> might have written:
    >
    > >Many years ago there was a limit of 64K lines, because of how
    > >the line number opcode worked in Python. Only machine
    > >generated Python code ever ran into that limit.

    >
    > What is the width of JUMP opcode offsets? If it is 16 bit, is there a
    > chance that someday somebody is going to write such a large basic block
    > that their program will fail?


    I'm pretty sure that limit has been lifted too (in the 2.0 timeframe?
    Not sure). I think you can have basic blocks the full 2^32 bytes long
    now :)

    Cheers,
    mwh

    --
    Check out the comments in this source file that start with:
    # Oh, lord help us.
    -- Mark Hammond gets to play with the Outlook object model
    Michael Hudson, Aug 22, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Dixon [MVP]

    Re: MailMessage Max Body Length

    Ray Dixon [MVP], Aug 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    789
    Corey Jackson
    Aug 25, 2003
  2. Jacky
    Replies:
    4
    Views:
    2,263
    Ken Cox [Microsoft MVP]
    Oct 27, 2003
  3. Summercool
    Replies:
    9
    Views:
    879
    dorayme
    Oct 23, 2007
  4. Greg Ferris

    Textarea max rows and max characters per row

    Greg Ferris, Jan 16, 2004, in forum: Javascript
    Replies:
    2
    Views:
    576
    Greg Ferris
    Jan 16, 2004
  5. kriton
    Replies:
    0
    Views:
    334
    kriton
    Apr 22, 2005
Loading...

Share This Page