summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Add rational.Rational as an implementation of numbers.Rational with infiniteJeffrey Yasskin2008-01-151-0/+279
| | | | | | | | | | | | | precision. This has been discussed at http://bugs.python.org/issue1682. It's useful primarily for teaching, but it also demonstrates how to implement a member of the numeric tower, including fallbacks for mixed-mode arithmetic. I expect to write a couple more patches in this area: * Rational.from_decimal() * Rational.trim/approximate() (maybe with different names) * Maybe remove the parentheses from Rational.__str__() * Maybe rename one of the Rational classes * Maybe make Rational('3/2') work.
* Temporarily revert 59967 until GC can be added.Raymond Hettinger2008-01-151-6/+0
|
* Issue 1820: structseq objects did not work with the % formatting operator ↵Raymond Hettinger2008-01-151-0/+6
| | | | | | or isinstance(t, tuple). Orignal patch (without tests) by Leif Walsh.
* Typo fixesAndrew M. Kuchling2008-01-151-1/+1
|
* Now that I've learnt about structseq objects I felt like converting ↵Christian Heimes2008-01-141-1/+1
| | | | | | sys.float_info to a structseq. It's readonly and help(sys.float_info) explains the attributes nicely.
* Applied patch #1816: sys.flags patchChristian Heimes2008-01-141-0/+12
|
* Added new an better structseq representation. E.g. repr(time.gmtime(0)) now ↵Christian Heimes2008-01-141-1/+5
| | | | returns 'time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)' instead of '(1970, 1, 1, 0, 0, 0, 3, 1, 0)'. The feature is part of #1816: sys.flags
* Issue 1780: Allow leading and trailing whitespace in Decimal constructor,Mark Dickinson2008-01-121-0/+8
| | | | | when constructing from a string. Disallow trailing newlines in Context.create_decimal.
* Doctest results return a named tuple for readabilityRaymond Hettinger2008-01-111-58/+58
|
* Run doctests on the collections moduleRaymond Hettinger2008-01-111-2/+4
|
* Closing issue1761.Amaury Forgeot d'Arc2008-01-101-0/+12
| | | | | | | | | | | | Surprising behaviour of the "$" regexp: it matches the end of the string, AND just before the newline at the end of the string:: re.sub('$', '#', 'foo\n') == 'foo#\n#' Python is consistent with Perl and the pcre library, so we just document it. Guido prefers "\Z" to match only the end of the string.
* Fixed #1776. __import__() no longer imports modules by file nameChristian Heimes2008-01-091-1/+11
|
* Added __enter__ and __exit__ functions to HKEY objectChristian Heimes2008-01-081-20/+25
| | | | Added ExpandEnvironmentStrings to the _winreg module.
* Patch 1137: allow assigning to .buffer_size attribute of PyExpat.parser objectsAndrew M. Kuchling2008-01-081-2/+128
|
* Issue #1757: The hash of a Decimal instance is no longer affectedFacundo Batista2008-01-081-0/+17
| | | | by the current context. Thanks Mark Dickinson.
* It's verbose, not debugChristian Heimes2008-01-081-1/+1
|
* Fixed indention problem that caused the second TIPC test to run on systems ↵Christian Heimes2008-01-071-1/+1
| | | | without TIPC
* #467924, patch by Alan McIntyre: Add ZipFile.extract and ZipFile.extractall.Georg Brandl2008-01-071-0/+56
|
* Issue #1646: Make socket support TIPC. The socket module now has supportChristian Heimes2008-01-071-0/+82
| | | | | for TIPC under Linux, see http://tipc.sf.net/ for more information. Thanks to Alberto Bertogli for the patch
* Fix issue 1747: allow classic classes to be checked for being subclasses ofJeffrey Yasskin2008-01-071-4/+11
| | | | ABCs.
* #1325: Add docs and tests for zipimporter.archive and zipimporter.prefix.Georg Brandl2008-01-061-0/+5
|
* #1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.Georg Brandl2008-01-062-0/+2
| | | | Reported by Jesse Towner.
* Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.Guido van Rossum2008-01-051-0/+5
| | | | Fix by John Nagle.
* Doc patch #1730 from Robin Stocker; minor corrections mostly to os.rst.Georg Brandl2008-01-051-1/+1
|
* Fix comment typoAndrew M. Kuchling2008-01-051-1/+1
|
* Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin2008-01-053-20/+16
| | | | | | | | | | | | round included: * Revert round to its 2.6 behavior (half away from 0). * Because round, floor, and ceil always return float again, it's no longer necessary to have them delegate to __xxx___, so I've ripped that out of their implementations and the Real ABC. This also helps in implementing types that work in both 2.6 and 3.0: you return int from the __xxx__ methods, and let it get enabled by the version upgrade. * Make pow(-1, .5) raise a ValueError again.
* clean up a commentFred Drake2008-01-051-2/+2
|
* Add error-checking to namedtuple's _replace() method.Raymond Hettinger2008-01-051-0/+7
|
* Improve namedtuple's _cast() method with a docstring, new name, and ↵Raymond Hettinger2008-01-051-4/+7
| | | | error-checking.
* Patch #1698 by Senthil: allow '@' in username when parsed by urlparse.py.Guido van Rossum2008-01-051-0/+18
|
* Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000Guido van Rossum2008-01-052-0/+13
| | | | and adds errors for -0x.
* socket.ioctl is only available on WindowsChristian Heimes2008-01-041-0/+10
|
* Issue #1735: TarFile.extractall() now correctly setsLars Gustäbel2008-01-041-0/+17
| | | | | | directory permissions and times. (will backport to 2.5)
* Make math.{floor,ceil}({int,long}) return float again for backwardsJeffrey Yasskin2008-01-041-0/+8
| | | | compatibility after r59671 made them return integral types.
* Minor fix-ups to named tuples:Raymond Hettinger2008-01-041-8/+1
| | | | | | | | | * Make the _replace() method respect subclassing. * Using property() to make _fields read-only wasn't a good idea. It caused len(Point._fields) to fail. * Add note to _cast() about length checking and alternative with the star-operator.
* Added _struct._clearcache() for regression testsChristian Heimes2008-01-041-0/+1
|
* Fixed refleak tests for _struct changesChristian Heimes2008-01-041-1/+0
|
* Bug #1481296: Fixed long(float('nan'))!=0L.Christian Heimes2008-01-041-0/+4
|
* Added copysign(x, y) function to the math moduleChristian Heimes2008-01-031-0/+7
|
* Added math.isinf() and math.isnan()Christian Heimes2008-01-031-0/+16
|
* Issue #1700, reported by Nguyen Quan Son, fix by Fredruk Lundh:Guido van Rossum2008-01-031-0/+30
| | | | | Regular Expression inline flags not handled correctly for some unicode characters. (Forward port from 2.5.2.)
* Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin2008-01-035-3/+187
| | | | | | | the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
* Change docstrings to comments so test output will display normally.Kurt B. Kaiser2008-01-021-3/+3
|
* Issue1177Kurt B. Kaiser2008-01-021-0/+13
| | | | | | | r58207 and r58247 patch logic is reversed. I noticed this when I tried to use urllib to retrieve a file which required auth. Fix that and add a test for 401 error to verify.
* Remove a straggling debugging print line.Brett Cannon2007-12-251-1/+0
|
* Actually execute the tests for the getter/setter/deleter tests on properties.Brett Cannon2007-12-251-7/+12
| | | | | | | | Also fix the test by having the test classes inherit from object. Are the getter/setter/deleter attributes supposed to be able to chain? As of right now they can't as the property tries to call what the property returns, which is another property when they are chained.
* Patch #1672 by Joseph Armbruster. Use tempdir() to get a temporary directory.Guido van Rossum2007-12-201-1/+1
|
* Add tests for the warnings module; specifically formatwarning and showwarning.Brett Cannon2007-12-201-1/+32
| | | | Still need tests for warn_explicit and simplefilter.
* Patch #1549 by Thomas Herve.Guido van Rossum2007-12-191-1/+61
| | | | | | This changes the rules for when __hash__ is inherited slightly, by allowing it to be inherited when one or more of __lt__, __le__, __gt__, __ge__ are overridden, as long as __eq__ and __ne__ aren't.
* Patch #1583 by Adam Olsen.Guido van Rossum2007-12-191-1/+48
| | | | | | | This adds signal.set_wakeup_fd(fd) which sets a file descriptor to which a zero byte will be written whenever a C exception handler runs. I added a simple C API as well, PySignal_SetWakeupFd(fd).