Commit Graph

33620 Commits

Author SHA1 Message Date
Martin v. Löwis 6cba25666c Change non-ASCII warning into a SyntaxError. 2006-02-28 22:41:29 +00:00
Thomas Wouters e4d3a72ab8 Include code.h more sanely. 2006-02-28 22:40:55 +00:00
Neal Norwitz 090b3dde06 No need to export PySTEntry_New, it is only used in symtable.c 2006-02-28 22:36:46 +00:00
Tim Peters 7ef75e46bb Set eol-style on new .py files. 2006-02-28 22:02:16 +00:00
Guido van Rossum 1a5e21e033 Updates to the with-statement:
- New semantics for __exit__() -- it must re-raise the exception
  if type is not None; the with-statement itself doesn't do this.
  (See the updated PEP for motivation.)

- Added context managers to:
  - file
  - thread.LockType
  - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore}
  - decimal.Context

- Added contextlib.py, which defines @contextmanager, nested(), closing().

- Unit tests all around; bot no docs yet.
2006-02-28 21:57:43 +00:00
Martin v. Löwis 87a8b4fee5 unparse.py can now unparse itself. 2006-02-28 21:41:30 +00:00
Neal Norwitz cd8ca8092f Add a note about removing the file once the bug is fixed 2006-02-28 20:40:50 +00:00
Tim Peters 84ef21c033 Its right now. 2006-02-28 20:39:06 +00:00
Neal Norwitz f16b706ada Ignore .pyc files 2006-02-28 20:24:18 +00:00
Neal Norwitz 055ec24bc4 Note that as generates a warning too 2006-02-28 20:06:49 +00:00
Neal Norwitz e42e405e08 Martin owns PEP 353 and did most of the work 2006-02-28 20:03:28 +00:00
Neal Norwitz 9193491eb3 Make __future__ features similar for with and absolute import since they were both added before a1 2006-02-28 20:02:42 +00:00
Thomas Wouters 5e9f1fa706 Generally inehrit codeflags that are in PyCF_MASK, instead of writing it out
in multiple places. This makes compile()/eval()/etc also inherit the
absolute-import codeflag, like division and with-statement already were.
2006-02-28 20:02:27 +00:00
Jeremy Hylton 56820c2bab Add some stats collection in debugging mode.
No good way to extract output yet.
2006-02-28 19:57:06 +00:00
Tim Peters dfc240450c Gave README a .txt extension. 2006-02-28 19:05:29 +00:00
Thomas Wouters 34aa7ba114 from __future__ import with_statement addon for 'with', mostly written by
Neal.
2006-02-28 19:02:24 +00:00
Neal Norwitz edc8f1366a Add directory which contains known ref leaks. Some of these are likely to be system dependent (like test_gestalt). 2006-02-28 19:02:05 +00:00
Jeremy Hylton 99b4ee6373 Use simple PyList to implement list of PyObject pointers 2006-02-28 18:52:28 +00:00
Tim Peters 400cbc3a44 Set EOL style to native. 2006-02-28 18:44:41 +00:00
Tim Peters 85b1052efe Another bit of unconstification. 2006-02-28 18:33:35 +00:00
Tim Peters 710ab3b5f8 Whitespace normalization. 2006-02-28 18:30:36 +00:00
Jeremy Hylton 08533fdad6 Tabify 2006-02-28 18:29:00 +00:00
Neal Norwitz 14ca327f99 Instead of printing the exception when you interrupt a test (Ctrl-C),
print the status so far and suppress printing the exception (but still exit).
2006-02-28 18:05:43 +00:00
Jeremy Hylton a829313d7b Remove asdl_seq_APPEND() and simplify asdl seq implementation.
Clarify intended use of set_context() and check errors at all call sites.
2006-02-28 17:58:27 +00:00
Neal Norwitz 03bdedd574 Update comments 2006-02-28 17:53:58 +00:00
Jeremy Hylton 77f1bb2778 Real arena implementation
Replace the toy arena implementation with a real one,
based on allocating 8K chunks of memory by default.
2006-02-28 17:53:04 +00:00
Neal Norwitz 77e42fff31 George Yoshida points out that the special characters
from Tools/compiler/ast.txt are not used anywhere else in asttable.txt.
So remove "\&".
2006-02-28 17:46:48 +00:00
Jeremy Hylton 7b03bade2b Test case to cover subscription bug from SF 1333982 2006-02-28 17:46:23 +00:00
Thomas Wouters fb609f4215 Wups, add NEWS item I'd written but not checked in. 2006-02-28 16:37:25 +00:00
Thomas Wouters f7f438ba3b SF patch #1438387, PEP 328: relative and absolute imports.
- IMPORT_NAME takes an extra argument from the stack: the relativeness of
   the import. Only passed to __import__ when it's not -1.

 - __import__() takes an optional 5th argument for the same thing; it
   __defaults to -1 (old semantics: try relative, then absolute)

 - 'from . import name' imports name (be it module or regular attribute)
   from the current module's *package*. Likewise, 'from .module import name'
   will import name from a sibling to the current module.

 - Importing from outside a package is not allowed; 'from . import sys' in a
   toplevel module will not work, nor will 'from .. import sys' in a
   (single-level) package.

 - 'from __future__ import absolute_import' will turn on the new semantics
   for import and from-import: imports will be absolute, except for
   from-import with dots.

Includes tests for regular imports and importhooks, parser changes and a
NEWS item, but no compiler-package changes or documentation changes.
2006-02-28 16:09:29 +00:00
Fredrik Lundh d3188639c3 markup glitch (spotted by George Yoshida) 2006-02-28 12:11:57 +00:00
Anthony Baxter d615110949 XXX something for amk's attention 2006-02-28 07:21:42 +00:00
Guido van Rossum baf3eb2410 Forgot to explain the effect of the new opcode.
Sigh -- we really should have one place for all opcode metadata.
2006-02-28 00:40:16 +00:00
Martin v. Löwis b003f041bb Generate return statement. 2006-02-28 00:37:04 +00:00
Martin v. Löwis ace990cf5a Regenerate. 2006-02-28 00:32:31 +00:00
Guido van Rossum 7ad94f011e Update the compiler package to compile the with-statement.
Jeremy, please review!
2006-02-28 00:32:16 +00:00
Martin v. Löwis 40d8459dbf Add generation of the version. 2006-02-28 00:30:54 +00:00
Neal Norwitz 17e59053fd Ignore resource file 2006-02-28 00:26:30 +00:00
Martin v. Löwis eae93b763c Add support for version field on Modules 2006-02-28 00:12:47 +00:00
Brett Cannon a7446e3438 Check the return code for PyErr_Warn() when warning about raising string
exceptions.  This was triggered when 'warnings' had a filter set to "error"
that caught the string exception deprecation warning.
2006-02-27 23:39:10 +00:00
Tim Peters a7444f47b2 PyErr_ProgramText(): Grrrrrr.
In a Windows debug build, trying to open a file using
an empty string as the name causes assertion death
inside MS's C runtime code.  We probably need to worm
around that in many places.  I'm worming around it here
to stop the new test_with.py from assert-dying in the
Windows debug build (it calls compile() with an empty
string for "the file name", which indirectly leads to
C-level code in Python trying to fopen("", "r")).
2006-02-27 23:29:46 +00:00
Neal Norwitz 0023a2f858 Finish removal of CO_GENERATOR_ALLOWED. 2006-02-27 23:24:48 +00:00
Martin v. Löwis 1d519e4625 unconst. 2006-02-27 23:10:11 +00:00
Thomas Wouters 1175c43a12 Clarify C-style exception handling with proper label name. 2006-02-27 22:49:54 +00:00
Thomas Wouters bfe51ea5c8 Fix assertions. 2006-02-27 22:48:55 +00:00
Guido van Rossum c2e20744b2 PEP 343 -- the with-statement.
This was started by Mike Bland and completed by Guido
(with help from Neal).

This still needs a __future__ statement added;
Thomas is working on Michael's patch for that aspect.

There's a small amount of code cleanup and refactoring
in ast.c, compile.c and ceval.c (I fixed the lltrace
behavior when EXT_POP is used -- however I had to make
lltrace a static global).
2006-02-27 22:32:47 +00:00
Martin v. Löwis 5fec904f84 Start of a source code unparser. 2006-02-27 21:41:03 +00:00
Neal Norwitz 9aaad88393 Even though we don't currently use unicode or complex numbers in the test,
be complete when when checking types.

Yield cannot be tested outside a function, so add a comment to that effect.
2006-02-27 21:08:23 +00:00
Brett Cannon be66e943c2 Don't filter out OverflowWarning; should be a test failure if it is raised by
the interpreter in 2.5 .
2006-02-27 20:03:56 +00:00
Martin v. Löwis 59977a677c Make or_test similar to test, not testlist. 2006-02-27 19:57:01 +00:00