1. 19 Jan, 2001 10 commits
    • Jeremy Hylton's avatar
      This patch introduces an extra pass to the compiler that generates a · e36f7781
      Jeremy Hylton authored
      symbol table for each top-level compilation unit.  The information in
      the symbol table allows the elimination of the later optimize() pass;
      the bytecode generation emits the correct opcodes.
      
      The current version passes the complete regression test, but may still
      contain some bugs.  It's a fairly substantial revision.  The current
      code adds an assert() and a test that may lead to a Py_FatalError().
      I expect to remove these before 2.1 beta 1.
      
      The symbol table (struct symtable) is described in comments in the
      code.
      
      The changes affects the several com_XXX() functions that were used to
      emit LOAD_NAME and its ilk.  The primary interface for this bytecode
      is now com_addop_varname() which takes a kind and a name, where kind
      is one of VAR_LOAD, VAR_STORE, or VAR_DELETE.
      
      There are many other smaller changes:
      
      - The name mangling code is no longer contained in ifdefs.  There are
        two functions that expose the mangling logical: com_mangle() and
        symtable_mangle().
      
      - The com_error() function can accept NULL for its first argument;
        this is useful with is_constant_false() is called during symbol
        table generation.
      
      - The loop index names used by list comprehensions have been changed
        from __1__ to [1], so that they can not be accessed by Python code.
      
      - in com_funcdef(), com_argdefs() is now called before the body of the
        function is compiled.  This provides consistency with com_lambdef()
        and symtable_funcdef().
      
      - Helpers do_pad(), dump(), and DUMP() are added to aid in debugging
        the compiler.
      e36f7781
    • Tim Peters's avatar
      Derivative of patch #102549, "simpler, faster(!) implementation of string.join". · 19fe14e7
      Tim Peters authored
      Also fixes two long-standing bugs (present in 2.0):
      1. .join() didn't check that the result size fit in an int.
      2. string.join(s) when len(s)==1 returned s[0] regardless of s[0]'s
         type; e.g., "".join([3]) returned 3 (overly optimistic optimization).
      I resisted a keen temptation to make .join() apply str() automagically.
      19fe14e7
    • Andrew M. Kuchling's avatar
      Revert a single line of my large change earlier today; this broke the ability · e3d6e41d
      Andrew M. Kuchling authored
          to build in a subdirectory.  The additional directory is unfortunately
          redundant when *not* building in a subdirectory, which is why I took
          it out.
      e3d6e41d
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      8dabbf14
    • Guido van Rossum's avatar
      SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class · 90cb9067
      Guido van Rossum authored
      for SocketServer.py (inherited by TCPServer)
      
      Luke wrote:
      
        The socketserver code, with a little bit of tweaking, can be made
        sufficiently general to service "requests" of any kind, not just by sockets.
        The BaseServer class was created, for example, to poll a table in a MYSQL
        database every 2 seconds. each entry in the table can be allocated a
        Handler which deals with the entry.
      
        With this patch, using BaseServer and ThreadedServer classes, the creation
        of the server that reads and handles MySQL table entries instead of a
        socket was utterly trivial: about 50 lines of python code.
      
        You may consider this code to be utterly useless [why would anyone else
        want to do anything like this???] - you are entitled to your opinion. if you
        think so, then think of this: have you considered how to cleanly add SSL to
        the TCPSocketServer? What about using shared memory as the
        communications mechanism for a server, instead of sockets? What about
        communication using files?
      
        The SocketServer code is extremely good every useful. it's just that as it
        stands, it is tied to sockets, which is not as useful.
      
      I heartily approve of this idea.
      90cb9067
    • Guido van Rossum's avatar
      SF Patch #103188, by Donn Cave: BeOS/ar-fake support for extra · 3fa560b3
      Guido van Rossum authored
      libraries.
      
      (I have no way to test this, I just trust Donn.)
      3fa560b3
    • Guido van Rossum's avatar
      SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin · 7150a778
      Guido van Rossum authored
      Support building this as a DLL under Cygwin.
      7150a778
    • Guido van Rossum's avatar
      6915c4d0
    • Guido van Rossum's avatar
      SF Patch #103250, by pj99: Optimize a strspn() out of startup. · fc5ce61a
      Guido van Rossum authored
      Minor startup speedup: avoid a call to strspn().
      fc5ce61a
  2. 18 Jan, 2001 30 commits