summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_types.py
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace normalization.Tim Peters2004-09-241-1/+1
|
* Add yet more tests for buffer().Neil Schemenauer2004-09-241-0/+11
|
* Add a few more tests for the buffer() object.Neil Schemenauer2004-09-241-0/+8
|
* Port the dictionary tests from test_types.py to unittest. Collect as muchWalter Dörwald2004-05-311-227/+1
| | | | | | mapping tests as possible in mapping_test.py and reuse the tests in test_dict.py, test_userdict.py, test_weakref.py, test_os.py and test_shelve.py. From SF patch #736962.
* SF #904720: dict.update should take a 2-tuple sequence like dict.__init_Raymond Hettinger2004-03-041-1/+1
| | | | | | | | (Championed by Bob Ippolito.) The update() method for mappings now accepts all the same argument forms as the dict() constructor. This includes item lists and/or keyword arguments.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-2/+2
| | | | From SF patch #852334.
* Fix test failure message (from SF patch #885008)Walter Dörwald2004-02-061-1/+1
|
* Move list and tuple tests from test_types.py to their own scripts:Walter Dörwald2003-12-081-276/+3
| | | | | | test_tuple.py and test_list.py. Common tests for tuple, list and UserList are shared (in seq_tests.py and list_tests.py). Port tests to PyUnit. (From SF patch #736962)
* Use _PyEval_SliceIndex to handle list.index() calls withWalter Dörwald2003-06-171-0/+9
| | | | huge start and stop arguments. Add tests.
* Fix sloppy index() implementation:Guido van Rossum2003-06-171-2/+6
| | | | | - don't use min() and max() - interpret negative start/stop argument like negative slice indices
* SF #754014: list.index() should accept optional start, end argumentsRaymond Hettinger2003-06-171-0/+16
| | | | Also, modified UserList.index() to match and expanded the related tests.
* Whitespace normalization.Tim Peters2003-05-121-4/+4
|
* SF bug #730296: Unexpected Changes in list IteratorRaymond Hettinger2003-05-071-4/+4
| | | | | | | | | | | | Reverted a Py2.3b1 change to iterator in subclasses of list and tuple. They had been changed to use __getitem__ whenever it had been overriden in the subclass. This caused some usabilty and performance problems. Also, it was inconsistent with the rest of python where many container methods access the underlying object directly without first checking for an overridden getter. Users needing a change in iterator behavior should override it directly.
* SF bug 665835: filter() treatment of str and tuple inconsistentRaymond Hettinger2003-04-241-0/+12
| | | | | | | | As a side issue on this bug, it was noted that list and tuple iterators used macros to directly access containers and would not recognize __getitem__ overrides. If the method is overridden, the patch returns a generic sequence iterator which calls the __getitem__ method; otherwise, it returns a high custom iterator with direct access to container elements.
* - bool() called without arguments now returns False rather thanGuido van Rossum2003-04-191-0/+10
| | | | | | | raising an exception. This is consistent with calling the constructors for the other builtin types -- called without argument they all return the false value of that type. (SF patch #724135) Thanks to Alex Martelli.
* - list.insert(i, x) now interprets negative i as it would beGuido van Rossum2003-04-141-0/+5
| | | | | | interpreted by slicing, so negative values count from the end of the list. This was the only place where such an interpretation was not placed on a list index.
* SF patch #693753: fix for bug 639806: default for dict.popRaymond Hettinger2003-03-061-1/+5
| | | | (contributed by Michael Stone.)
* Fix SF bug #689659, 64-bit int and long hash keys incompatibleNeal Norwitz2003-02-231-0/+8
| | | | | On a 64-bit machine, a dictionary could contain duplicate int/long keys if the value was > 2**32.
* Cleaned up test (removing bogus argument list).Raymond Hettinger2002-12-071-2/+2
|
* Remove assumption that cls is a subclass of dict.Raymond Hettinger2002-12-071-3/+3
| | | | Simplifies the code and gets Just van Rossum's example to work.
* The final tweaks before closingMichael W. Hudson2002-12-051-0/+4
| | | | | | [ 633152 ] list slice ass ignores subtypes of list Allow arbitrary sequences on the RHS of extended slices.
* Replace BadInternalCall with TypeError. Add a test case. Fix whitespace.Raymond Hettinger2002-12-041-0/+7
| | | | | | | Just van Rossum showed a weird, but clever way for pure python code to trigger the BadInternalCall. The C code had assumed that calling a class constructor would return an instance of that class; however, classes that abuse __new__ can invalidate that assumption.
* SF Patch 643443. Added dict.fromkeys(iterable, value=None), a classRaymond Hettinger2002-11-271-0/+28
| | | | method for constructing new dictionaries from sequences of keys.
* Change int() so that passing a string, unicode, float or long argumentWalter Dörwald2002-11-191-6/+6
| | | | | | | 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
* SF patch 637176: list.sort crasherTim Peters2002-11-121-2/+2
| | | | | | | | | | | 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.
* This is Alex Martelli's patchMichael W. Hudson2002-11-051-0/+4
| | | | | | [ 633870 ] allow any seq assignment to a list slice plus a very silly little test case of my own.
* Fix forMichael W. Hudson2002-07-291-0/+3
| | | | | | [ 587875 ] crash on deleting extended slice The array code got simpler, always a good thing!
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Whitespace normalization.Tim Peters2002-07-161-1/+1
|
* Add a check that the bug Jeremy just fixed in _PyTuple_Resize() isGuido van Rossum2002-06-211-0/+5
| | | | | | fixed. (Jeremy, how did you discover that?)
* Fix the bug described inMichael W. Hudson2002-06-191-0/+8
| | | | | | | | | http://mail.python.org/pipermail/python-dev/2002-June/025461.html with test cases. Also includes extended slice support for arrays, which I thought I'd already checked in but obviously not.
* Test exceptional conditions in list.sort()Neal Norwitz2002-06-131-0/+15
|
* Fix for problem reported by Neal Norwitz. Tighten up calculation ofMichael W. Hudson2002-06-111-0/+2
| | | | slicelength. Include his test case.
* This is my nearly two year old patchMichael W. Hudson2002-06-111-0/+72
| | | | | | | | | [ 400998 ] experimental support for extended slicing on lists somewhat spruced up and better tested than it was when I wrote it. Includes docs & tests. The whatsnew section needs expanding, and arrays should support extended slices -- later.
* Buffer-object repitition and concatenation has worked all along; add a testFred Drake2002-05-021-0/+6
| | | | to make avoid regression.
* Whitespace normalization.Tim Peters2002-04-161-1/+1
|
* Add Raymond Hettinger's d.pop(). See SF patch 539949.Guido van Rossum2002-04-121-0/+15
|
* Add more tests for built-in types. Add tests for buffer objects.Neil Schemenauer2002-03-241-0/+118
| | | | Closes SF patch 494871.
* Whitespace normalization.Tim Peters2001-12-201-1/+0
|
* Additional coverage tests by Neil Norwitz.Guido van Rossum2001-12-111-0/+9
| | | | (SF patch #491418, #491420, #491421.)
* Change new tests to use integer division (// instead of /).Tim Peters2001-12-051-3/+3
|
* SF bug #488480: integer multiply to return -max_int-1.Tim Peters2001-12-041-0/+26
| | | | | | | int_mul(): new and vastly simpler overflow checking. Whether it's faster or slower will likely vary across platforms, favoring boxes with fast floating point. OTOH, we no longer have to worry about people shipping broken LONG_BIT definitions <0.9 wink>.
* Add a bunch of tests for extended dict.update() where the argument isBarry Warsaw2001-06-261-0/+70
| | | | | a non-dictionary mapping object. Include tests for several expected failure modes.
* Implement, test and document "key in dict" and "key not in dict".Guido van Rossum2001-04-201-0/+4
| | | | | | | | | I know some people don't like this -- if it's really controversial, I'll take it out again. (If it's only Alex Martelli who doesn't like it, that doesn't count as "real controversial" though. :-) That's why this is a separate checkin from the iterators stuff I'm about to check in next.
* Update the code to better reflect recommended style:Fred Drake2000-12-121-75/+75
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Added test for {}.popitem().Guido van Rossum2000-12-121-0/+24
|
* Backing out my changes.Moshe Zadka2000-11-301-6/+0
| | | | Improved version coming soon to a Source Forge near you!
* Added .first{item,value,key}() to dictionaries.Moshe Zadka2000-11-301-0/+6
| | | | | Complete with docos and tests. OKed by Guido.
* Make reindent.py happy (convert everything to 4-space indents!).Fred Drake2000-10-231-13/+13
|
* Barry's patch to test the new setdefault() method.Guido van Rossum2000-08-081-0/+12
|