Commit Graph

2086 Commits

Author SHA1 Message Date
Michael W. Hudson 586da8fddd Readjustments to the way we cope with exceptions from subclasses'
mro() methods.  Now any exception aborts the whole __bases__ change.

And more tests.
2002-11-27 15:20:19 +00:00
Michael W. Hudson caf17be1b7 I had the inheritance cycle stuff backwards. Oops! 2002-11-27 10:24:44 +00:00
Martin v. Löwis e16e01fac6 Patch #639112: fixes for None locale and tz. 2002-11-27 08:30:25 +00:00
Raymond Hettinger e4827eb2a2 Bring UserDict in-sync with changes to dict.
Constructor accepts optional keyword arguments after a optional items list.
Add fromkeys() as an alternate constructor from an iterable over keys.
Expand related unittests.
2002-11-27 08:29:11 +00:00
Raymond Hettinger e33d3df030 SF Patch 643443. Added dict.fromkeys(iterable, value=None), a class
method for constructing new dictionaries from sequences of keys.
2002-11-27 07:29:33 +00:00
Guido van Rossum a01fa26396 The MRO conflict error message depends on dictionary hash order.
Avoid depending on this in the test.
2002-11-27 04:00:59 +00:00
Fred Drake 4dd0f7ef7a Add a way to say "use any resource except A". For example, to run
allow the use of any resource except bsddb, give the option
"-uall,-bsddb".
2002-11-26 21:44:56 +00:00
Michael W. Hudson 98bbc49c54 This is my patch:
[ 635933 ] make some type attrs writable

Plus a couple of extra tests beyond what's up there.

It hasn't been as carefully reviewed as it perhaps should, so all readers
are encouraged, nay exhorted, to give this a close reading.

There are still a couple of oddities related to assigning to __name__,
but I intend to solicit python-dev's opinions on these.
2002-11-26 14:47:27 +00:00
Guido van Rossum d32047f038 A tweaked version of Jeremy's patch #642489, to produce better error
messages about MRO conflicts.  (Tweaks here: don't print the message,
but compare it with an expected string.)
2002-11-25 21:38:52 +00:00
Raymond Hettinger 35e48d2426 SF 643115: Set._update() had a special case for dictionaries which allowed
non-true values to leak in.  This threw-off equality testing which depends
on the underlying dictionaries having both the same keys and values.
2002-11-25 20:43:55 +00:00
Walter Dörwald 00445d2393 Fix typo in comment. 2002-11-25 17:58:02 +00:00
Martin v. Löwis d5169bad94 Regenerate from Unicode 3.2.0 to include all First/Last ranges. 2002-11-24 23:10:08 +00:00
Tim Peters 1babdfc48a Reduced memory burden by iterating over the normalization test input
file directly (instead of sucking it all into a list of lines first).
2002-11-24 19:19:09 +00:00
Tim Peters 1b445d3fcf Fiddled things so that test_normalization is expected to be skipped if
and only if the test input file doesn't exist.
2002-11-24 18:53:11 +00:00
Tim Peters d332c085ea Skip test_normalization on Windows until it's at least clear why the
data it needs doesn't exist in the project.  If it's a huge file,
maybe the test should be changed to be one of the -u thingies.
2002-11-24 02:40:40 +00:00
Tim Peters b9ac505110 Split long line.
XXX If NormalizationTest.txt is required to run this test, why isn't it
checked into the project?
2002-11-24 02:37:29 +00:00
Tim Peters 77c06fbf94 Whitespace normalization. 2002-11-24 02:35:35 +00:00
Martin v. Löwis 677bde2dd1 Patch #626485: Support Unicode normalization. 2002-11-23 22:08:15 +00:00
Martin v. Löwis 74a530d42d Update character names. 2002-11-23 19:41:01 +00:00
Martin v. Löwis ef7fe2e813 Implement names for CJK unified ideographs. Add name to KeyError output.
Verify that the lookup for an existing name succeeds.
2002-11-23 18:01:32 +00:00
Martin v. Löwis 8579efc86c Add test cases for Hangul syllables. Update output. 2002-11-23 17:11:42 +00:00
Neal Norwitz ca2953ea5c Remove duplicate test 2002-11-23 16:57:00 +00:00
Just van Rossum a797d8150d Patch #642500 with slight modifications: allow keyword arguments in
dict() constructor. Example:
  >>> dict(a=1, b=2)
  {'a': 1, 'b': 2}
  >>>
2002-11-23 09:45:04 +00:00
Fred Drake 8bec48316b Two bugs:
- assertRaises() wasn't being called correctly
- test_warning() no longer applies
2002-11-22 20:13:43 +00:00
Tim Peters 78e35f9311 Move Windows Python away from bsddb 1.85 and toward Sleepycat's latest.
The bsddb subproject is gone.
The _bsddb subproject is new.
There are problems here, but I'm out of time to work on this now.  If
anyone can address an XXX comment or two in readme.txt, please do!
2002-11-22 20:00:34 +00:00
Raymond Hettinger 54405456e5 Implement dict() style constructor.
Already supported dict() and dict(mapping).
Now supports dict(itemsequence) and
Just van Rossum's new syntax for dict(keywordargs).

Also, added related unittests.

The docs already promise dict-like behavior
so no update is needed there.
2002-11-22 00:07:40 +00:00
Martin v. Löwis d899605e30 Patch #633547: Support plural forms. Do TODOs in test suite. 2002-11-21 21:45:32 +00:00
Walter Dörwald f171540ab8 Change int() so that passing a string, unicode, float or long argument
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.

This fixes SF bug http://www.python.org/sf/635115
2002-11-19 20:49:15 +00:00
Martin v. Löwis 1c6b1a2b4e Importing test suite from bsddb3 3.4.0 (with modifications). 2002-11-19 17:47:07 +00:00
Neil Schemenauer b981df9943 check for str.__mod__ 2002-11-18 16:12:11 +00:00
Neil Schemenauer ab9e4b76c2 check for unicode.__mod__ 2002-11-18 16:11:34 +00:00
Raymond Hettinger 8ddc176e2e Improve DictMixin.
Replaced docstring with comments.  Prevents subclass contamination.
Added the missing __cmp__() method and a test for __cmp__().
Used try/except style in preference to has_key() followed by a look-up.
Used iteritem() where possible to save creating a long key list and
   to save redundant lookups.
Expanded .update() to look for the most helpful methods first and gradually
   work down to a mininum expected interface.
Expanded documentation to be more clear on how to use the class.
2002-11-18 04:34:10 +00:00
Tim Peters a1d004af04 Style guide reformats. I saw this test fail on a very heavily loaded
Win98SE box, but whatever the cause, it had scrolled off the DOS box.
(There was just the "test_queue failed" summary at the end of the
regrtest run.)
2002-11-15 19:08:50 +00:00
Raymond Hettinger 903bf90723 SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
2002-11-15 08:39:40 +00:00
Guido van Rossum 9a81892100 Fix or disable some tests that were affected by the new C3 MRO
algorithm, and add some new tests for the C3 algorithm.
2002-11-14 19:50:14 +00:00
Tim Peters c293704e93 This uses only one temp file at a time, so use test_support.TESTFN as
the name instead of enduring nanny "security warnings" from
tempfile.mktemp().
2002-11-14 16:23:29 +00:00
Jeremy Hylton 4c8be8510b Add some simple tests of the persistence hooks. 2002-11-13 22:10:47 +00:00
Jeremy Hylton 5e0f4e73a9 Remove inst_persistent_id() WANNI (we ain't never needed it).
Add some simple tests of the persistence hooks.
2002-11-13 22:01:27 +00:00
Jeremy Hylton 0e1183ddff remove debugging print 2002-11-13 22:00:02 +00:00
Jeremy Hylton cd58b8f532 Add getstate and setstate implementation to concrete set classes. 2002-11-13 19:34:26 +00:00
Neal Norwitz 80a1bf4b5d Fix SF # 635969, No error "not all arguments converted"
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
	newstr = 'format without a percent' % string_value

This fix raises an exception again when there are no formats
and % with a string value.
2002-11-12 23:01:12 +00:00
Tim Peters b9099c3df4 SF patch 637176: list.sort crasher
Armin Rigo's Draconian but effective fix for

SF bug 453523: list.sort crasher

slightly fiddled to catch more cases of list mutation.  The dreaded
internal "immutable list type" is gone!  OTOH, if you look at a list
*while* it's being sorted now, it will appear to be empty.  Better
than a core dump.
2002-11-12 22:08:10 +00:00
Martin v. Löwis 3ae84b6389 Allow both string and Unicode objects in levels. 2002-11-09 20:19:12 +00:00
Martin v. Löwis 2411a2dd82 Don't try to convert the test filename to Unicode with -U. 2002-11-09 19:57:26 +00:00
Tim Peters 44a7910873 I already forgot what I changed -- it wasn't important <wink>. 2002-11-09 06:51:30 +00:00
Tim Peters 63c1081ae3 OK -- all tests pass on Windows now. The rest were due to 3 more
binary-vs-text-mode screwups.
2002-11-09 06:49:43 +00:00
Tim Peters 9de06bd605 More tests run on Windows now. Something is still wrong here, but no
idea what.  Added liberal XXX explanations for the next guy.
2002-11-09 06:45:31 +00:00
Tim Peters 499d09af92 Many changes to get this to pass on Windows, and to make it easier to
figure out what the code was doing.  The fixes were a combination of
closing open files before deletion, opening files in binary mode, and
plain skipping things that can't work on Windows (BaseTest.decompress
uses a process gimmick that doesn't exist on Windows, and, even if it
did, assumes a "bunzip2" executable is on PATH).
2002-11-09 06:31:56 +00:00
Tim Peters 3de75266aa Whitespace normalization. 2002-11-09 05:26:15 +00:00
Tim Peters e7130315a5 Comment out the test docstrings so we can at least tell which tests are
failing.
2002-11-09 05:22:41 +00:00