1. 17 Sep, 2001 15 commits
    • Jeremy Hylton's avatar
      API change: · 29f233d6
      Jeremy Hylton authored
      compile() becomes replacement for builtin compile()
      compileFile() generates a .pyc from a .py
      both are exported in __init__
      
      compiler.parse() gets optional second argument to specify compilation
      mode, e.g. single, eval, exec
      
      Add AbstractCompileMode as parent class and Module, Expression, and
      Interactive as concrete subclasses.  Each corresponds to a compilation
      mode.
      
      THe AbstractCompileMode instances in turn delegate to CodeGeneration
      subclasses specialized for their particular functions --
      ModuleCodeGenerator, ExpressionCodeGeneration,
      InteractiveCodeGenerator.
      29f233d6
    • Jeremy Hylton's avatar
    • Jeremy Hylton's avatar
      Fix calculation of hardest_arg. · a7f29d09
      Jeremy Hylton authored
      The argument properties are ordered from easiest to hardest.  The
      harder the arg, the more complicated that code that must be generated
      to return it from getChildren() and/or getChildNodes().  The old
      calculation routine was bogus, because it always set hardest_arg to
      the hardness of the last argument.  Now use max() to always set it to
      the hardness of the hardest argument.
      a7f29d09
    • Jeremy Hylton's avatar
      Last set of change to get regression tests to pass · c9787e88
      Jeremy Hylton authored
      Remove the only test in the syntax module.  It ends up that the
      transformer must handle this error case.
      
      In the transformer, check for a list compression in com_assign_list()
      by looking for a list_for node where a comma is expected.
      
      In pycodegen.compile() re-raise the SyntaxError rather than catching
      it and exiting
      c9787e88
    • Guido van Rossum's avatar
      Add support for restricting access based on restricted execution mode. · 3018b5ec
      Guido van Rossum authored
      Renamed the 'readonly' field to 'flags' and defined some new flag
      bits: READ_RESTRICTED and WRITE_RESTRICTED, as well as a shortcut
      RESTRICTED that means both.
      3018b5ec
    • Jeremy Hylton's avatar
      Add -p option to invoke Python profiler · f408d7e6
      Jeremy Hylton authored
      f408d7e6
    • Jeremy Hylton's avatar
      Only print attributes that start with co_. · 2b468893
      Jeremy Hylton authored
      If passed a .py file as an argument, try to find its accompanying
      .pyc.
      2b468893
    • Jeremy Hylton's avatar
      Handle more syntax errors. · ae096387
      Jeremy Hylton authored
      Invoke compiler.syntax.check() after building AST.  If a SyntaxError
      occurs, print the error and exit without generating a .pyc file.
      
      Refactor code to use compiler.misc.set_filename() rather than passing
      filename argument around to each CodeGenerator instance.
      ae096387
    • Jeremy Hylton's avatar
      818a42c4
    • Fredrik Lundh's avatar
      Brian Quinlan's XML-RPC server framework. · 62be97c0
      Fredrik Lundh authored
      62be97c0
    • Jeremy Hylton's avatar
      support true division · b696648d
      Jeremy Hylton authored
      b696648d
    • Andrew M. Kuchling's avatar
      [Patch #462255, from Jason Tishler] Re-enables building the resouce · 01fa634b
      Andrew M. Kuchling authored
          module on the Cygwin platform.
      01fa634b
    • Guido van Rossum's avatar
      SF patch #461781 by Chris Lawrence: os.path.realpath - Resolve symlinks: · a5ad73ef
      Guido van Rossum authored
         Once upon a time, I put together a little function
         that tries to find the canonical filename for a given
         pathname on POSIX. I've finally gotten around to
         turning it into a proper patch with documentation.
         On non-POSIX, I made it an alias for 'abspath', as
         that's the behavior on POSIX when no symlinks are
         encountered in the path.
      
         Example:
         >>> os.path.realpath('/usr/bin/X11/X')
         '/usr/X11R6/bin/X'
      a5ad73ef
    • Guido van Rossum's avatar
      Add cross-compilation defaults to most AC_TRY_RUN values. The · 1f8a18bb
      Guido van Rossum authored
      supplied values are the most "normal" or "common" values found for
      recent 32 bit machines.  This now seems to work to build Python 2.2
      for the ARM processor used on the iPAQ.
      1f8a18bb
    • Tim Peters's avatar
      PyObject_Dir(): Merge in __members__ and __methods__ too (if they exist, · cf758599
      Tim Peters authored
      and are lists, and then just the string elements (if any)).
      
      There are good and bad reasons for this.  The good reason is to support
      dir() "like before" on objects of extension types that haven't migrated
      to the class introspection API yet.  The bad reason is that Python's own
      method objects are such a type, and this is the quickest way to get their
      im_self etc attrs to "show up" via dir().  It looks much messier to move
      them to the new scheme, as their current getattr implementation presents
      a view of their attrs that's a untion of their own attrs plus their
      im_func's attrs.  In particular, methodobject.__dict__ actually returns
      methodobject.im_func.__dict__, and if that's important to preserve it
      doesn't seem to fit the class introspection model at all.
      cf758599
  2. 16 Sep, 2001 3 commits
  3. 15 Sep, 2001 5 commits
  4. 14 Sep, 2001 17 commits