summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* Use decorators.Guido van Rossum2005-01-161-3/+4
|
* Whitespace normalization.Tim Peters2004-12-071-13/+13
|
* SF patch #1077353: add key= argument to min and maxRaymond Hettinger2004-12-031-4/+75
| | | | (First draft of patch contributed by Steven Bethard.)
* Improve test coverage.Raymond Hettinger2004-09-301-0/+3
|
* Checkin Tim's fix to an error discussed on python-dev.Raymond Hettinger2004-09-261-0/+5
| | | | | | | | | | | | | | | | | Also, add a testcase. Formerly, the list_extend() code used several local variables to remember its state across iterations. Since an iteration could call arbitrary Python code, it was possible for the list state to be changed. The new code uses dynamic structure references instead of C locals. So, they are always up-to-date. After list_resize() is called, its size has been updated but the new cells are filled with NULLs. These needed to be filled before arbitrary iteration code was called; otherwise, that code could attempt to modify a list that was in a semi-invalid state. The solution was to change the ob->size field back to a value reflecting the actual number of valid cells.
* Subclasses of string can no longer be interned. The semantics ofJeremy Hylton2004-08-071-0/+17
| | | | | | | | | | | interning were not clear here -- a subclass could be mutable, for example -- and had bugs. Explicitly interning a subclass of string via intern() will raise a TypeError. Internal operations that attempt to intern a string subclass will have no effect. Added a few tests to test_builtin that includes the old buggy code and verifies that calls like PyObject_SetAttr() don't fail. Perhaps these tests should have gone in test_string.
* SF bug #1004669: Type returned from .keys() is not checkedRaymond Hettinger2004-08-071-0/+9
|
* Completed the patch for Bug #215126.Raymond Hettinger2004-08-021-0/+25
| | | | | | | * Fixes an incorrect variable in a PyDict_CheckExact. * Allow general mapping locals arguments for the execfile() function and exec statement. * Add tests.
* * Fix missing return after error message is set.Raymond Hettinger2004-07-061-0/+1
| | | | * Add a test case that would have caught it.
* SF Bug #215126: Over restricted type checking on eval() functionRaymond Hettinger2004-07-021-1/+55
| | | | | | The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-2/+2
| | | | From SF patch #852334.
* Fix input() builtin function to respect compiler flags.Hye-Shik Chang2004-02-021-0/+13
| | | | (SF patch 876178, patch by mwh, unittest by perky)
* Guido grants a Christmas wish:Raymond Hettinger2003-12-171-2/+35
| | | | sorted() becomes a regular function instead of a classmethod.
* - Removed FutureWarnings related to hex/oct literals and conversionsGuido van Rossum2003-11-291-3/+2
| | | | | | | | | | and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) This addresses most of the remaining semantic changes promised by PEP 237, except for repr() of a long, which still shows the trailing 'L'. The PEP appears to promise warnings for operations that changed semantics compared to Python 2.3, but this is not implemented; we've suffered through enough warnings related to hex/oct literals and I think it's best to be silent now.
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-3/+2
| | | | | | | | * Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.
* Deleting cyclic object comparison.Armin Rigo2003-10-281-6/+6
| | | | | SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html
* Make a copy of L before appending, so the global L remainsWalter Dörwald2003-08-151-4/+4
| | | | | | unchanged (and sys.gettotalrefcount() remains constant). Fix a few typos.
* As discussed on python-dev, changed builtin.zip() to handle zero argumentsRaymond Hettinger2003-08-021-1/+2
| | | | by returning an empty list instead of raising a TypeError.
* Port test_complex.py to unittest.Walter Dörwald2003-06-181-56/+0
| | | | | | | | Move the constructor tests from test_builtin to test_complex. Add a bunch of tests (code coverage is a 94%). From SF patch #736962.
* Used sets.Set() to compare unordered sequences.Raymond Hettinger2003-05-021-11/+3
| | | | Improves clarity and brevity.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-3/+1
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Adding new built-in function sum, with docs and tests.Alex Martelli2003-04-221-0/+21
|
* Add a few errors tests for range().Walter Dörwald2003-04-151-0/+6
|
* test_range(): The C code changed to raise TypeError in one of theseTim Peters2003-04-151-1/+1
| | | | cases, but the test still expected ValueError. Repaired that.
* Patch by Chad Netzer (with significant change):Guido van Rossum2003-04-111-0/+35
| | | | | | | - range() now works even if the arguments are longs with magnitude larger than sys.maxint, as long as the total length of the sequence fits. E.g., range(2**100, 2**101, 2**100) is the following list: [1267650600228229401496703205376L]. (SF patch #707427.)
* Whitespace normalization.Tim Peters2003-02-191-15/+15
|
* Change filtertuple() to use tp_as_sequence->sq_itemWalter Dörwald2003-02-101-2/+1
| | | | | instead of PyTuple_GetItem, so an overwritten __getitem__ in a tuple subclass works. SF bug #665835.
* Change filterstring() and filterunicode(): If theWalter Dörwald2003-02-101-13/+27
| | | | | | | | | | | | object is not a real str or unicode but an instance of a subclass, construct the output via looping over __getitem__. This guarantees that the result is the same for function==None and function==lambda x:x This doesn't happen for tuples, because filtertuple() uses PyTuple_GetItem(). (This was discussed on SF bug #665835).
* patch #683515: "Add unicode support to compile(), eval() and exec"Just van Rossum2003-02-101-0/+4
| | | | Incorporated nnorwitz's comment re. Py__USING_UNICODE.
* patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bomJust van Rossum2003-02-091-0/+4
| | | | mark. Added unit test.
* Make sure filter() never returns tuple, str or unicodeWalter Dörwald2003-02-041-0/+23
| | | | subclasses. (Discussed in SF patch #665835)
* Add a test that checks that filter() honors the sq_item slot forWalter Dörwald2003-02-041-0/+13
| | | | | str and unicode subclasses not just for generating the output but for testing too.
* filterstring() and filterunicode() in Python/bltinmodule.cWalter Dörwald2003-02-041-0/+21
| | | | | | | | | | | | | blindly assumed that tp_as_sequence->sq_item always returns a str or unicode object. This might fail with str or unicode subclasses. This patch checks whether the object returned from __getitem__ is a str/unicode object and raises a TypeError if not (and the filter function returned true). Furthermore the result for __getitem__ can be more than one character long, so checks for enough memory have to be done.
* Fix SF bug# 676155, RuntimeWarning with tp_compareNeal Norwitz2003-01-281-0/+1
| | | | Check return value of PyLong_AsDouble(), it can return an error.
* Fix comment typosWalter Dörwald2003-01-271-3/+4
|
* Patch #636005: Filter unicode into unicode.Martin v. Löwis2003-01-251-0/+6
|
* Combine test_b1.py and test_b2.py into test_builtin.py,Walter Dörwald2003-01-191-9/+1075
| | | | | | | | port the tests to PyUnit and add many tests for error cases. This increases code coverage in Python/bltinmodule.c from 75% to 92%. (From SF patch #662807, with assert_(not fcmp(x, y)) replaced with assertAlmostEqual(x, y) where possible)
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-3/+3
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Initial revisionGuido van Rossum1992-01-271-0/+13