1. 01 Nis, 2009 1 kayıt (commit)
  2. 03 Kas, 2008 1 kayıt (commit)
    • Benjamin Peterson's avatar
      Merged revisions 67028,67040,67044,67046,67052,67065,67070,67077,67082 via svnmerge from · c0747cf5
      Benjamin Peterson yazdı
      svn+ssh://pythondev@svn.python.org/python/trunk
      
      ........
        r67028 | benjamin.peterson | 2008-10-25 18:27:07 -0500 (Sat, 25 Oct 2008) | 1 line
      
        don't use a catch-all
      ........
        r67040 | armin.rigo | 2008-10-28 12:01:21 -0500 (Tue, 28 Oct 2008) | 5 lines
      
        Fix one of the tests: it relied on being present in an "output test" in
        order to actually test what it was supposed to test, i.e. that the code
        in the __del__ method did not crash.  Use instead the new helper
        test_support.captured_output().
      ........
        r67044 | amaury.forgeotdarc | 2008-10-29 18:15:57 -0500 (Wed, 29 Oct 2008) | 3 lines
      
        Correct error message in io.open():
        closefd=True is the only accepted value with a file name.
      ........
        r67046 | thomas.heller | 2008-10-30 15:18:13 -0500 (Thu, 30 Oct 2008) | 2 lines
      
        Fixed a modulefinder crash on certain relative imports.
      ........
        r67052 | christian.heimes | 2008-10-30 16:26:15 -0500 (Thu, 30 Oct 2008) | 1 line
      
        Issue #4237: io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members.
      ........
        r67065 | benjamin.peterson | 2008-10-30 18:59:18 -0500 (Thu, 30 Oct 2008) | 1 line
      
        move unprefixed error into .c file
      ........
        r67070 | benjamin.peterson | 2008-10-31 15:41:44 -0500 (Fri, 31 Oct 2008) | 1 line
      
        rephrase has_key doc
      ........
        r67077 | benjamin.peterson | 2008-11-03 09:14:51 -0600 (Mon, 03 Nov 2008) | 1 line
      
        #4048 make the parser module accept relative imports as valid
      ........
        r67082 | hirokazu.yamamoto | 2008-11-03 12:03:06 -0600 (Mon, 03 Nov 2008) | 2 lines
      
        Issue #3774: Fixed an error when create a Tkinter menu item without command
        and then remove it. Written by Guilherme Polo (gpolo).
      ........
      c0747cf5
  3. 26 Mar, 2008 1 kayıt (commit)
    • Christian Heimes's avatar
      Merged revisions 61952-61953 via svnmerge from · 4d6ec85a
      Christian Heimes yazdı
      svn+ssh://pythondev@svn.python.org/python/trunk
      
      ........
        r61952 | mark.dickinson | 2008-03-26 22:41:36 +0100 (Wed, 26 Mar 2008) | 2 lines
      
        Typo: "objects reference count" -> "object's reference count"
      ........
        r61953 | christian.heimes | 2008-03-26 23:01:37 +0100 (Wed, 26 Mar 2008) | 4 lines
      
        Patch #2477: Added from __future__ import unicode_literals
      
        The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
      ........
      4d6ec85a
  4. 20 Mar, 2008 1 kayıt (commit)
  5. 21 Nis, 2006 1 kayıt (commit)
  6. 28 Şub, 2006 4 kayıt (commit)
  7. 17 Ara, 2005 1 kayıt (commit)
  8. 23 Eki, 2005 1 kayıt (commit)
  9. 21 Eki, 2005 1 kayıt (commit)
  10. 20 Eki, 2005 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Merge ast-branch to head · 3e0055f8
      Jeremy Hylton yazdı
      This change implements a new bytecode compiler, based on a
      transformation of the parse tree to an abstract syntax defined in
      Parser/Python.asdl.
      
      The compiler implementation is not complete, but it is in stable
      enough shape to run the entire test suite excepting two disabled
      tests.
      3e0055f8
  11. 12 Şub, 2004 1 kayıt (commit)
  12. 05 Şub, 2003 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Small function call optimization and special build option for call stats. · 985eba53
      Jeremy Hylton yazdı
      -DCALL_PROFILE: Count the number of function calls executed.
      
      When this symbol is defined, the ceval mainloop and helper functions
      count the number of function calls made.  It keeps detailed statistics
      about what kind of object was called and whether the call hit any of
      the special fast paths in the code.
      
      Optimization:
      
      When we take the fast_function() path, which seems to be taken for
      most function calls, and there is minimal frame setup to do, avoid
      call PyEval_EvalCodeEx().  The eval code ex function does a lot of
      work to handle keywords args and star args, free variables,
      generators, etc.  The inlined version simply allocates the frame and
      copies the arguments values into the frame.
      
      The optimization gets a little help from compile.c which adds a
      CO_NOFREE flag to code objects that don't have free variables or cell
      variables.  This change allows fast_function() to get into the fast
      path with fewer tests.
      
      I measure a couple of percent speedup in pystone with this change, but
      there's surely more that can be done.
      985eba53
  13. 11 Ara, 2002 1 kayıt (commit)
  14. 12 Agu, 2002 1 kayıt (commit)
  15. 12 Nis, 2002 1 kayıt (commit)
  16. 13 Ara, 2001 1 kayıt (commit)
  17. 10 Agu, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Refactor future feature handling · fdd12f66
      Jeremy Hylton yazdı
      Replace individual slots in PyFutureFeatures with a single bitmask
      with one field per feature.  The flags for this bitmask are the same
      as the flags used in the co_flags slot of a code object.
      
          XXX This means we waste several bits, because they are used
          for co_flags but have no meaning for future statements.  Don't
          think this is an issue.
      
      Remove the NESTED_SCOPES_DEFAULT define and others.  Not sure what
      they were for anyway.
      
      Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the
      CO_xxx flags that are relevant for this release.
      
      Change definition of PyCompilerFlags so that cf_flags matches
      co_flags.
      fdd12f66
  18. 08 Agu, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Implement PEP 238 in its (almost) full glory. · 4668b000
      Guido van Rossum yazdı
      This introduces:
      
      - A new operator // that means floor division (the kind of division
        where 1/2 is 0).
      
      - The "future division" statement ("from __future__ import division)
        which changes the meaning of the / operator to implement "true
        division" (where 1/2 is 0.5).
      
      - New overloadable operators __truediv__ and __floordiv__.
      
      - New slots in the PyNumberMethods struct for true and floor division,
        new abstract APIs for them, new opcodes, and so on.
      
      I emphasize that without the future division statement, the semantics
      of / will remain unchanged until Python 3.0.
      
      Not yet implemented are warnings (default off) when / is used with int
      or long arguments.
      
      This has been on display since 7/31 as SF patch #443474.
      
      Flames to /dev/null.
      4668b000
  19. 16 Tem, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Part way to allowing "from __future__ import generators" to communicate · 5ba58662
      Tim Peters yazdı
      that info to code dynamically compiled *by* code compiled with generators
      enabled.  Doesn't yet work because there's still no way to tell the parser
      that "yield" is OK (unlike nested_scopes, the parser has its fingers in
      this too).
      Replaced PyEval_GetNestedScopes by a more-general
      PyEval_MergeCompilerFlags.  Perhaps I should not have?  I doubted it was
      *intended* to be part of the public API, so just did.
      5ba58662
  20. 15 Tem, 2001 1 kayıt (commit)
  21. 12 Tem, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Enable nested scopes by default. · aa314298
      Guido van Rossum yazdı
      Although this is a one-character change, more work needs to be done:
      the compiler can get rid of a lot of non-nested-scopes code, the
      documentation needs to be updated, the future statement can be
      simplified, etc.
      
      But this change enables the nested scope semantics everywhere, and
      that's the important part -- we can now test code for compatibility
      with nested scopes by default.
      aa314298
  22. 18 Haz, 2001 1 kayıt (commit)
  23. 22 Mar, 2001 1 kayıt (commit)
  24. 01 Mar, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Useful future statement support for the interactive interpreter · 9f324e96
      Jeremy Hylton yazdı
      (Also remove warning about module-level global decl, because we can't
      distinguish from code passed to exec.)
      
      Define PyCompilerFlags type contains a single element,
      cf_nested_scopes, that is true if a nested scopes future statement has
      been entered at the interactive prompt.
      
      New API functions:
          PyNode_CompileFlags()
          PyRun_InteractiveOneFlags()
          -- same as their non Flags counterparts except that the take an
             optional PyCompilerFlags pointer
      
      compile.c: In jcompile() use PyCompilerFlags argument.  If
          cf_nested_scopes is true, compile code with nested scopes.  If it
          is false, but the code has a valid future nested scopes statement,
          set it to true.
      
      pythonrun.c: Create a new PyCompilerFlags object in
          PyRun_InteractiveLoop() and thread it through to
          PyRun_InteractiveOneFlags().
      9f324e96
  25. 28 Şub, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Presumed correct compiler pass for future statements · 39e2f3f8
      Jeremy Hylton yazdı
      XXX still need to integrate into symtable API
      
      compile.h: Remove ff_n_simple_stmt; obsolete.
      
                 Add ff_found_docstring used internally to skip one and only
                 one string at the beginning of a module.
      
      compile.c: Add check for from __future__ imports to far into the file.
      
       	   In symtable_global() check for -1 returned from
      	   symtable_lookup(), which signifies name not defined.
      
      	   Add missing DECERF in symtable_add_def.
      
                 Free c->c_future.
      
      future.c:  Add special handling for multiple statements joined on a
      	   single line using one or more semicolons; this form can
                 include an illegal future statement that would otherwise be
                 hard to detect.
      
      	   Add support for detecting and skipping doc strings.
      39e2f3f8
  26. 27 Şub, 2001 2 kayıt (commit)
    • Jeremy Hylton's avatar
      Improved __future__ parser; still more to do · 4db62b1e
      Jeremy Hylton yazdı
      Makefile.pre.in: add target future.o
      
      Include/compile.h: define PyFutureFeaters and PyNode_Future()
                         add c_future slot to struct compiling
      
      Include/symtable.h: add st_future slot to struct symtable
      
      Python/future.c: implementation of PyNode_Future()
      
      Python/compile.c: use PyNode_Future() for nested_scopes support
      
      Python/symtable.c: include compile.h to pick up PyFutureFeatures decl
      4db62b1e
    • Jeremy Hylton's avatar
      Preliminary support for future nested scopes · 29906eef
      Jeremy Hylton yazdı
      compile.h: #define NESTED_SCOPES_DEFAULT 0 for Python 2.1
                 __future__ feature name: "nested_scopes"
      
      symtable.h: Add st_nested_scopes slot.  Define flags to track exec and
          import star.
      
      Lib/test/test_scope.py: requires nested scopes
      
      compile.c: Fiddle with error messages.
      
          Reverse the sense of ste_optimized flag on
          PySymtableEntryObjects.  If it is true, there is an optimization
          conflict.
      
          Modify get_ref_type to respect st_nested_scopes flags.
      
          Refactor symtable_load_symbols() into several smaller functions,
          which use struct symbol_info to share variables.  In new function
          symtable_update_flags(), raise an error or warning for import * or
          bare exec that conflicts with nested scopes.  Also, modify handle
          for free variables to respect st_nested_scopes flag.
      
          In symtable_init() assign st_nested_scopes flag to
          NESTED_SCOPES_DEFAULT (defined in compile.h).
      
          Add preliminary and often incorrect implementation of
          symtable_check_future().
      
          Add symtable_lookup() helper for future use.
      29906eef
  27. 25 Ock, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      PEP 227 implementation · 64949cb7
      Jeremy Hylton yazdı
      The majority of the changes are in the compiler.  The mainloop changes
      primarily to implement the new opcodes and to pass a function's
      closure to eval_code2().  Frames and functions got new slots to hold
      the closure.
      
      Include/compile.h
          Add co_freevars and co_cellvars slots to code objects.
          Update PyCode_New() to take freevars and cellvars as arguments
      Include/funcobject.h
          Add func_closure slot to function objects.
          Add GetClosure()/SetClosure() functions (and corresponding
          macros) for getting at the closure.
      Include/frameobject.h
          PyFrame_New() now takes a closure.
      Include/opcode.h
          Add four new opcodes: MAKE_CLOSURE, LOAD_CLOSURE, LOAD_DEREF,
          STORE_DEREF.
          Remove comment about old requirement for opcodes to fit in 7
          bits.
      compile.c
          Implement changes to code objects for co_freevars and co_cellvars.
      
          Modify symbol table to use st_cur_name (string object for the name
          of the current scope) and st_cur_children (list of nested blocks).
          Also define st_nested, which might more properly be called
          st_cur_nested.  Add several DEF_XXX flags to track def-use
          information for free variables.
      
          New or modified functions of note:
          com_make_closure(struct compiling *, PyCodeObject *)
              Emit LOAD_CLOSURE opcodes as needed to pass cells for free
              variables into nested scope.
          com_addop_varname(struct compiling *, int, char *)
              Emits opcodes for LOAD_DEREF and STORE_DEREF.
          get_ref_type(struct compiling *, char *name)
              Return NAME_CLOSURE if ref type is FREE or CELL
          symtable_load_symbols(struct compiling *)
              Decides what variables are cell or free based on def-use info.
              Can now raise SyntaxError if nested scopes are mixed with
              exec or from blah import *.
          make_scope_info(PyObject *, PyObject *, int, int)
              Helper functions for symtable scope stack.
          symtable_update_free_vars(struct symtable *)
              After a code block has been analyzed, it must check each of
              its children for free variables that are not defined in the
              block.  If a variable is free in a child and not defined in
              the parent, then it is defined by block the enclosing the
              current one or it is a global.  This does the right logic.
          symtable_add_use() is now a macro for symtable_add_def()
          symtable_assign(struct symtable *, node *)
              Use goto instead of for (;;)
      
          Fixed bug in symtable where name of keyword argument in function
          call was treated as assignment in the scope of the call site. Ex:
              def f():
                  g(a=2) # a was considered a local of f
      
      ceval.c
          eval_code2() now take one more argument, a closure.
          Implement LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF, MAKE_CLOSURE>
      
          Also: When name error occurs for global variable, report that the
          name was global in the error mesage.
      
      Objects/frameobject.c
          Initialize f_closure to be a tuple containing space for cellvars
          and freevars.  f_closure is NULL if neither are present.
      Objects/funcobject.c
          Add support for func_closure.
      Python/import.c
          Change the magic number.
      Python/marshal.c
          Track changes to code objects.
      64949cb7
  28. 01 Eyl, 2000 1 kayıt (commit)
  29. 09 Tem, 2000 1 kayıt (commit)
  30. 30 Haz, 2000 2 kayıt (commit)
  31. 04 Ara, 1998 1 kayıt (commit)
  32. 07 Eki, 1998 1 kayıt (commit)
  33. 24 Ock, 1997 1 kayıt (commit)
  34. 17 Ock, 1997 1 kayıt (commit)
  35. 25 Eki, 1996 1 kayıt (commit)