Commit Graph

33783 Commits

Author SHA1 Message Date
Brett Cannon eb6b0eec29 Fix test_iterlen by returning the iterator of dict views. Problem is that
iteritems and itervalues' previous object were both an iterator *and* and
iterable.  The tests expected an iterator but were given an iterable.

Should the 2to3 conversion for iter(values|items|keys) change the code to
``iter(dict.keys())`` to be more compatible?
2007-02-22 04:45:13 +00:00
Brett Cannon 861fd6fdb9 Fix xml.dom.minidom so it works again after the dict views introduction.
There are some methods in minidom that return dict.keys() directly.  There were
left alone since the tests passed without touching them, but it might be
prudent to just wrap them in a 'list' call to be safe for people expecting a
list.
2007-02-21 22:05:37 +00:00
Brett Cannon ecca313aa4 Fix test_mutants for dict views. 2007-02-21 21:59:58 +00:00
Brett Cannon 67582d2bee Fix test_os from breakage due to dict views. 2007-02-21 21:57:55 +00:00
Brett Cannon b38e2bcfd4 Fix plistlib to work with dict views. 2007-02-21 21:18:18 +00:00
Guido van Rossum 75d26ccd7a Some more test now pass. 2007-02-15 04:01:01 +00:00
Guido van Rossum d81206d152 Fix the damage to UserDict and its tests.
Clearly this is not the right way to fix this; UserDict and MixinDict
ought to be redesigned with the new dict API in mind.  But I'm not
claiming to be in charge of library redesign, I only want zero failing
tests.
2007-02-15 03:49:08 +00:00
Guido van Rossum e34cdd1bc1 Fix for test_dict.py, thanks to Eduardo O Padoan. 2007-02-14 17:49:04 +00:00
Guido van Rossum d4588c18f2 Get rid of some old TO TO items. 2007-02-13 19:55:23 +00:00
Guido van Rossum 4726942ceb List of broken tests at this time. If you fix a test, please update this file. 2007-02-13 05:46:39 +00:00
Guido van Rossum d9214d1f2c Make dict.keys() and dict.items() comparable to sets, using == and !=.
(PEP 3106 requires subset comparisons too, those will come later if someone
really wants them. :-)
2007-02-12 02:23:40 +00:00
Guido van Rossum e19aad4c7b Fix unittest. 2007-02-12 00:23:56 +00:00
Guido van Rossum dde4c2ca56 Fix another unit test. 2007-02-12 00:22:55 +00:00
Guido van Rossum 8b8a543a7b Make test_logging pass. 2007-02-12 00:07:01 +00:00
Georg Brandl c2d9d7f489 Checkin the regenerated Python-ast.c and fix test_optparse. 2007-02-11 23:06:17 +00:00
Guido van Rossum 07f2436fa8 Nailed test_weakref.py. Pfew, messy! 2007-02-11 22:59:48 +00:00
Guido van Rossum 9afbb4e364 Two more trivial fixes. 2007-02-11 18:54:18 +00:00
Guido van Rossum cd70eee244 Another fix. Partly reverted the tweaks done by the previous fix. 2007-02-11 18:53:00 +00:00
Guido van Rossum 091153d43b Make test_sax pass. 2007-02-11 18:44:55 +00:00
Guido van Rossum 87b639505b With the help of the improved fixer, test_with.py is now fixed. 2007-02-11 07:05:21 +00:00
Guido van Rossum cc2b016125 - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views.

The dict views aren't fully functional yet; in particular, they can't
be compared to sets yet.  but they are useful as "iterator wells".

There are still 27 failing unit tests; I expect that many of these
have fairly trivial fixes, but there are so many, I could use help.
2007-02-11 06:12:03 +00:00
Guido van Rossum 4e66dfcdc4 Random change to make this work unchanged when dict.keys() returns a dict view. 2007-02-10 22:53:17 +00:00
Guido van Rossum 3ac6741f79 Implement __contains__ for dict_keys and dict_items.
(Not for dict_values, where it can't be done faster than
the default implementation which just iterates the elements.)
2007-02-10 18:55:06 +00:00
Guido van Rossum 83825acd1b Endow dict views with a proper length method. 2007-02-10 04:54:19 +00:00
Guido van Rossum b90c84889e Very preliminary work on dict views. 2007-02-10 01:11:45 +00:00
Guido van Rossum 8b545369ea News about softspace. 2007-02-09 23:52:14 +00:00
Guido van Rossum e0192e576f Fix the remaining doctest failures.
One was a modified line that was echoed in an exception;
the other two were softspace problems, fixed clumsily but effectively.
2007-02-09 23:39:59 +00:00
Guido van Rossum 79f5543685 Ignore *.py[co]. 2007-02-09 23:38:28 +00:00
Guido van Rossum 96bf7e8a37 Fix test_frozen. 2007-02-09 23:27:01 +00:00
Guido van Rossum 79139b247b Kill off softspace completely (except in formatter.py which seems to have
a different feature with the same name).
The change to test_doctest.txt reduces the doctest failures to 3.
2007-02-09 23:20:19 +00:00
Guido van Rossum bdc36e4d9e Redue the failure rate to 13 tests. Bah. 2007-02-09 22:43:47 +00:00
Guido van Rossum 0bcbb0d4d4 Fix the roundtripping function. 2007-02-09 22:43:10 +00:00
Guido van Rossum 9b8850439c Fairly subtle fix for failing tests. 2007-02-09 22:36:02 +00:00
Guido van Rossum 8df511b5f6 Trivial fix for test_profile.py. 2007-02-09 22:28:28 +00:00
Guido van Rossum 4e4035b9ac Found another difference between old and new print:
old print would suppress the softspace after \t.
2007-02-09 22:27:36 +00:00
Guido van Rossum 43fc78ddc8 More prints embedded in strings. 2007-02-09 22:18:41 +00:00
Guido van Rossum ceae375da1 Fix a bogus end=' ' here. 2007-02-09 22:16:54 +00:00
Guido van Rossum 374812c5af Two tests fixed with one fix. 2007-02-09 22:11:20 +00:00
Guido van Rossum c420b2f3ee Fix another test. 2007-02-09 22:09:01 +00:00
Guido van Rossum d8c19672a7 Some more tests pass now. (Also test_compiler.py with -u all.) 2007-02-09 21:54:58 +00:00
Georg Brandl 88fc6646d1 * Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.
* Fix some docstrings and one Print -> print.
* Fix test_{class,code,descrtut,dis,extcall,parser,popen,pkg,subprocess,syntax,traceback}.
  These were the ones that generated code with a print statement.
  In most remaining failing tests there's an issue with the soft space.
2007-02-09 21:28:07 +00:00
Guido van Rossum 08c47ba0df Fix an unfortunate mis-conversion: sometimes "print x," must be
converted to "print(x, end=' ')", but other times it must be converted
to "print(x, end='')".  There's no easy way to find out, because it
depends on whether x ends with a newline.  I'm sure I'll find more
like this.
2007-02-09 20:50:08 +00:00
Guido van Rossum fff80dfa4a Revert doubly-converted doctests. 2007-02-09 20:33:44 +00:00
Guido van Rossum 7131f84400 Fix a bunch of doctests with the -d option of refactor.py.
We still have 27 failing tests (down from 39).
2007-02-09 20:13:25 +00:00
Guido van Rossum 4502c804b9 Note that print is a function now. 2007-02-09 05:42:38 +00:00
Guido van Rossum be19ed77dd Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.

(Oh, and I don't know if the compiler package works.)
2007-02-09 05:37:30 +00:00
Guido van Rossum 452bf519a7 Essential changes for print function changes.
Lib will be changed in a separate run.
2007-02-09 05:32:43 +00:00
Martin v. Löwis 21298cfea6 Remove bogus INCREF of ziptuple: it is a
freshly-allocated tuple object.
2007-02-06 21:30:59 +00:00
Martin v. Löwis 14b6d92e21 Fix refcounting bugs related to CONVERT_BINOP. 2007-02-06 21:05:30 +00:00
Thomas Wouters 9fe394c1be Merged revisions 53538-53622 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r53545 | andrew.kuchling | 2007-01-24 21:06:41 +0100 (Wed, 24 Jan 2007) | 1 line

  Strengthen warning about using lock()
........
  r53556 | thomas.heller | 2007-01-25 19:34:14 +0100 (Thu, 25 Jan 2007) | 3 lines

  Fix for #1643874: When calling SysAllocString, create a PyCObject
  which will eventually call SysFreeString to free the BSTR resource.
........
  r53563 | andrew.kuchling | 2007-01-25 21:02:13 +0100 (Thu, 25 Jan 2007) | 1 line

  Add item
........
  r53564 | brett.cannon | 2007-01-25 21:22:02 +0100 (Thu, 25 Jan 2007) | 8 lines

  Fix time.strptime's %U support.  Basically rewrote the algorithm to be more
  generic so that one only has to shift certain values based on whether the week
  was specified to start on Monday or Sunday.  Cut out a lot of edge case code
  compared to the previous version.  Also broke algorithm out into its own
  function (that is private to the module).

  Fixes bug #1643943 (thanks Biran Nahas for the report).
........
  r53570 | brett.cannon | 2007-01-26 00:30:39 +0100 (Fri, 26 Jan 2007) | 4 lines

  Remove specific mention of my name and email address from modules.  Not really
  needed and all bug reports should go to the bug tracker, not directly to me.
  Plus I am not the only person to have edited these files at this point.
........
  r53573 | fred.drake | 2007-01-26 17:28:44 +0100 (Fri, 26 Jan 2007) | 1 line

  fix typo (extraneous ")")
........
  r53575 | georg.brandl | 2007-01-27 18:43:02 +0100 (Sat, 27 Jan 2007) | 4 lines

  Patch #1638243: the compiler package is now able to correctly compile
  a with statement; previously, executing code containing a with statement
  compiled by the compiler package crashed the interpreter.
........
  r53578 | georg.brandl | 2007-01-27 18:59:42 +0100 (Sat, 27 Jan 2007) | 3 lines

  Patch #1634778: add missing encoding aliases for iso8859_15 and
  iso8859_16.
........
  r53579 | georg.brandl | 2007-01-27 20:38:50 +0100 (Sat, 27 Jan 2007) | 2 lines

  Bug #1645944: os.access now returns bool but docstring is not updated
........
  r53590 | brett.cannon | 2007-01-28 21:58:00 +0100 (Sun, 28 Jan 2007) | 2 lines

  Use the thread lock's context manager instead of a try/finally statement.
........
  r53591 | brett.cannon | 2007-01-29 05:41:44 +0100 (Mon, 29 Jan 2007) | 2 lines

  Add a test for slicing an exception.
........
  r53594 | andrew.kuchling | 2007-01-29 21:21:43 +0100 (Mon, 29 Jan 2007) | 1 line

  Minor edits to the curses HOWTO
........
  r53596 | andrew.kuchling | 2007-01-29 21:55:40 +0100 (Mon, 29 Jan 2007) | 1 line

  Various minor edits
........
  r53597 | andrew.kuchling | 2007-01-29 22:28:48 +0100 (Mon, 29 Jan 2007) | 1 line

  More edits
........
  r53601 | tim.peters | 2007-01-30 04:03:46 +0100 (Tue, 30 Jan 2007) | 2 lines

  Whitespace normalization.
........
  r53603 | georg.brandl | 2007-01-30 21:21:30 +0100 (Tue, 30 Jan 2007) | 2 lines

  Bug #1648191: typo in docs.
........
  r53605 | brett.cannon | 2007-01-30 22:34:36 +0100 (Tue, 30 Jan 2007) | 8 lines

  No more raising of string exceptions!

  The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
  a TypeError.  Trying to catch a string exception raises a DeprecationWarning.
  References to string exceptions has been removed from the docs since they are
  now just an error.
........
  r53618 | raymond.hettinger | 2007-02-01 22:02:59 +0100 (Thu, 01 Feb 2007) | 1 line

  Bug #1648179:  set.update() not recognizing __iter__ overrides in dict subclasses.
........
2007-02-05 01:24:16 +00:00