Commit graph

10529 commits

Author SHA1 Message Date
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
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
Tim Peters
400cbc3a44 Set EOL style to native. 2006-02-28 18:44:41 +00:00
Tim Peters
710ab3b5f8 Whitespace normalization. 2006-02-28 18:30:36 +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
Neal Norwitz
03bdedd574 Update comments 2006-02-28 17:53:58 +00:00
Jeremy Hylton
7b03bade2b Test case to cover subscription bug from SF 1333982 2006-02-28 17:46:23 +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
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
Guido van Rossum
7ad94f011e Update the compiler package to compile the with-statement.
Jeremy, please review!
2006-02-28 00:32:16 +00:00
Neal Norwitz
0023a2f858 Finish removal of CO_GENERATOR_ALLOWED. 2006-02-27 23:24:48 +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
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
Martin v. Löwis
415ed937c2 Skip over doc strings. 2006-02-27 19:56:30 +00:00
Martin v. Löwis
16c7f71380 Handle testlist_safe and or_test like testlist. 2006-02-27 16:11:03 +00:00
Martin v. Löwis
49a1302952 Alias non-terminals introduced for backwards compatibility. 2006-02-27 16:03:39 +00:00
Anthony Baxter
322a23f21b regenerated. please read PEP 306 when changing Python's grammar! 2006-02-27 06:49:54 +00:00
Thomas Wouters
dca3b9c797 PEP 308 implementation, including minor refdocs and some testcases. It
breaks the parser module, because it adds the if/else construct as well as
two new grammar rules for backward compatibility. If no one else fixes
parsermodule, I guess I'll go ahead and fix it later this week.

The TeX code was checked with texcheck.py, but not rendered. There is
actually a slight incompatibility:

>>> (x for x in lambda:0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: iteration over non-sequence

changes into

>>> (x for x in lambda: 0)
  File "<stdin>", line 1
    (x for x in lambda: 0)
                     ^
SyntaxError: invalid syntax

Since there's no way the former version can be useful, it's probably a
bugfix ;)
2006-02-27 00:24:13 +00:00
Martin v. Löwis
bd260da900 Generate code to recursively copy an AST into
a tree of Python objects. Expose this through compile().
2006-02-26 19:42:26 +00:00
Tim Peters
d6e7e73ff8 Whitespace normalization. 2006-02-26 04:21:50 +00:00
Guido van Rossum
1968ad32cd - Patch 1433928:
- The copy module now "copies" function objects (as atomic objects).
  - dict.__getitem__ now looks for a __missing__ hook before raising
    KeyError.
  - Added a new type, defaultdict, to the collections module.
    This uses the new __missing__ hook behavior added to dict (see above).
2006-02-25 22:38:04 +00:00
Jack Jansen
de540e2288 Got rid of byte-order dependencies. 2006-02-23 14:54:30 +00:00
Georg Brandl
418a1ef089 RFE #1436243: make integers in [0..256] preallocated. 2006-02-22 11:30:06 +00:00
Georg Brandl
6a29c323ba Add test for classmethod ./. keyword args. 2006-02-21 22:17:46 +00:00
Tim Peters
42a3deb7b5 Suppress another deprecation warning in the tests. 2006-02-21 03:28:49 +00:00
Tim Peters
32cbc96150 Whitespace normalization. 2006-02-20 21:42:18 +00:00
Georg Brandl
a223d2cb29 Bug #1210377: close bsddb cursor correctly after NotFoundError. 2006-02-20 20:29:52 +00:00
Martin v. Löwis
de2cde614c Detect Win64 builds. 2006-02-20 12:26:58 +00:00
Martin v. Löwis
e46af8c367 Let the SDK setup override distutils logic. 2006-02-20 12:15:15 +00:00
Georg Brandl
5771310a09 Bug #1101233: fix test_fcntl on netbsd2 platform. 2006-02-20 10:32:02 +00:00
Georg Brandl
8f7c54eaa5 Bug #1413790: zipfile now sanitizes absolute archive names that are
not allowed by the specs.
2006-02-20 08:40:38 +00:00
Tim Peters
200a58058a Whitespace normalization. 2006-02-19 21:26:07 +00:00
Tim Peters
4d7cad115d Repair new test failures on Windows due to
implicit assumptions that there's no difference
between text and binary modes.
2006-02-19 21:22:10 +00:00
Marc-André Lemburg
fe4b34cc4b Fix the encodings package codec search function to only search
inside its own package. Fixes problem reported in patch #1433198.

Add codec search function for codec test codec.
2006-02-19 15:22:22 +00:00
Georg Brandl
c98eeede17 Patch #1215184: FileInput now can be given an opening hook which can
be used to control how files are opened.
2006-02-19 14:57:47 +00:00
Georg Brandl
c029f873cb Patch #1212287: fileinput.input() now has a mode parameter for
specifying the file mode input files should be opened with.
2006-02-19 14:12:34 +00:00
Georg Brandl
67e9fb9d7a Patch #1215184: fileinput now has a fileno() function for getting the
current file number.
2006-02-19 13:56:17 +00:00
Georg Brandl
602b9ba6b3 Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtin namespace.
2006-02-19 13:26:36 +00:00
Georg Brandl
e466217ab9 Patch #1337756: fileinput now accepts Unicode filenames. 2006-02-19 09:51:27 +00:00
Tim Peters
2a8ec996ce test_gopher(): Squash another deprecation
warning about gopherlib.
2006-02-19 05:09:00 +00:00
Georg Brandl
19e2203fff Add a unit test for bug fix #1396678. 2006-02-19 01:21:11 +00:00
Georg Brandl
26caeba35a Bug #1396678: a closed bsddb.DB raises AttributeError on repr().
It now returns "{}". Is that the correct solution?
2006-02-19 00:53:54 +00:00
Neal Norwitz
bb45973455 This fixes test _locale failing on macteagle (Mac OS 10.4 AFAIK).
Google for:  eu_ES decimal point
shows that BSD locales had the eu_ES decimal point as
a single quote (') instead of a comma (,).

This was seems to have been fixed 15 months ago, but it's not on our
Mac and presumably others.  So skip this broken locale.
2006-02-19 00:13:15 +00:00
Georg Brandl
1f63670a2a Patch #1426648: urllib proxy_bypass broken 2006-02-18 23:10:23 +00:00
Neal Norwitz
d5b6715083 This should get test_timeout to pass when running on any python.org host. Will backport 2006-02-18 21:20:31 +00:00
Georg Brandl
7b4e7c24df Patch #1373643: The chunk module can now read chunks larger than
two gigabytes.
2006-02-18 21:10:56 +00:00