1. 19 Jan, 2001 11 commits
    • Jeremy Hylton's avatar
    • Jeremy Hylton's avatar
      This patch introduces an extra pass to the compiler that generates a · 77b6b9e2
      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.
      77b6b9e2
    • Tim Peters's avatar
      Derivative of patch #102549, "simpler, faster(!) implementation of string.join". · a8ea8a35
      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.
      a8ea8a35
    • Andrew M. Kuchling's avatar
      Revert a single line of my large change earlier today; this broke the ability · 2e1f9d43
      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.
      2e1f9d43
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      1b82b16a
    • Guido van Rossum's avatar
      SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class · 6cacf8b1
      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.
      6cacf8b1
    • Guido van Rossum's avatar
      SF Patch #103188, by Donn Cave: BeOS/ar-fake support for extra · bde42c63
      Guido van Rossum authored
      libraries.
      
      (I have no way to test this, I just trust Donn.)
      bde42c63
    • Guido van Rossum's avatar
      SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin · 3965aacc
      Guido van Rossum authored
      Support building this as a DLL under Cygwin.
      3965aacc
    • Guido van Rossum's avatar
      b63572f3
    • Guido van Rossum's avatar
      SF Patch #103250, by pj99: Optimize a strspn() out of startup. · 72391309
      Guido van Rossum authored
      Minor startup speedup: avoid a call to strspn().
      72391309
  2. 18 Jan, 2001 29 commits