Commit graph

12433 commits

Author SHA1 Message Date
Mark Dickinson
59bc20bb27 Issue 1780: Allow leading and trailing whitespace in Decimal constructor,
when constructing from a string. Disallow trailing newlines in
Context.create_decimal.
2008-01-12 01:56:00 +00:00
Thomas Heller
c682614df0 Raise an error instead of crashing with a segfault when a NULL
function pointer is called.

Will backport to release25-maint.
2008-01-11 19:34:06 +00:00
Raymond Hettinger
0f6a656ec1 Speed-up and simplify code urlparse's result objects. 2008-01-11 18:04:55 +00:00
Raymond Hettinger
0ff4dafee0 Improve usability of the SequenceMatcher by returning named tuples describing match ranges. 2008-01-11 03:20:54 +00:00
Raymond Hettinger
e896acc98c Let most inspect functions return named tuples 2008-01-11 03:04:50 +00:00
Raymond Hettinger
097a190303 Have Decimal.as_tuple return a named tuple. 2008-01-11 02:24:13 +00:00
Raymond Hettinger
fff4e6e171 Doctest results return a named tuple for readability 2008-01-11 01:25:54 +00:00
Raymond Hettinger
d1ef85420f Run doctests on the collections module 2008-01-11 00:23:13 +00:00
Raymond Hettinger
15b5e55b48 Neaten-up the named tuple docs 2008-01-10 23:00:01 +00:00
Amaury Forgeot d'Arc
d08a8ebf2a Closing issue1761.
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.
2008-01-10 21:59:42 +00:00
Raymond Hettinger
e850c466c7 Clarify how to add a field to a named tuple. 2008-01-10 20:37:12 +00:00
Raymond Hettinger
e1655088ca Examples for named tuple subclassing should include __slots__ 2008-01-10 19:15:10 +00:00
Christian Heimes
3403f1589d Fixed #1776. __import__() no longer imports modules by file name 2008-01-09 19:56:33 +00:00
Christian Heimes
b39a756afd Added __enter__ and __exit__ functions to HKEY object
Added ExpandEnvironmentStrings to the _winreg module.
2008-01-08 15:46:10 +00:00
Andrew M. Kuchling
e0a49b6e05 Patch 1137: allow assigning to .buffer_size attribute of PyExpat.parser objects 2008-01-08 14:30:55 +00:00
Facundo Batista
52b25795c0 Issue #1757: The hash of a Decimal instance is no longer affected
by the current context.  Thanks Mark Dickinson.
2008-01-08 12:25:20 +00:00
Christian Heimes
f66f95d419 It's verbose, not debug 2008-01-08 03:40:04 +00:00
Raymond Hettinger
581671419f Expand comment. 2008-01-08 02:02:05 +00:00
Raymond Hettinger
f5e8af1bb7 Use get() instead of pop() for the optimized version of _replace(). 2008-01-07 20:56:05 +00:00
Raymond Hettinger
9a359210aa Cleanup named tuple subclassing example. 2008-01-07 20:07:38 +00:00
Christian Heimes
4d7e6702e9 Fixed indention problem that caused the second TIPC test to run on systems without TIPC 2008-01-07 19:58:41 +00:00
Georg Brandl
62416bcf5a #467924, patch by Alan McIntyre: Add ZipFile.extract and ZipFile.extractall. 2008-01-07 18:47:44 +00:00
Christian Heimes
fb2d25a154 Issue #1646: Make socket support TIPC. The socket module now has support
for TIPC under Linux, see http://tipc.sf.net/ for more information.
Thanks to Alberto Bertogli for the patch
2008-01-07 16:12:44 +00:00
Raymond Hettinger
dc55f35f38 Add another named tuple subclassing example. 2008-01-07 09:03:49 +00:00
Jeffrey Yasskin
fd1c24518b Fix issue 1747: allow classic classes to be checked for being subclasses of
ABCs.
2008-01-07 06:09:40 +00:00
Raymond Hettinger
1db6f80cd5 Cleanup subclassing example to more clearly show fixed-width print format. 2008-01-07 05:50:35 +00:00
Raymond Hettinger
b8e0072fec Add subclassing example to docs for named tuples. 2008-01-07 04:24:49 +00:00
Raymond Hettinger
844f71b7e4 Speed-up named tuple's _make() constructor. 2008-01-06 22:11:54 +00:00
Georg Brandl
e260ba2d33 #1325: Add docs and tests for zipimporter.archive and zipimporter.prefix. 2008-01-06 16:49:50 +00:00
Georg Brandl
c45346f57a #1591: Clarify docstring of Popen3. 2008-01-06 14:33:52 +00:00
Georg Brandl
183a084da3 #1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.
Reported by Jesse Towner.
2008-01-06 14:27:15 +00:00
Georg Brandl
e2a902c669 #1696393: don't check for '.' and '..' in ntpath.walk since
they aren't returned from os.listdir anymore.
Reported by Michael Haggerty.
2008-01-06 14:17:36 +00:00
Raymond Hettinger
1166872006 Small code simplification. Forgot that classmethods can be called from intances. 2008-01-06 09:02:24 +00:00
Guido van Rossum
c6a04c2629 Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.
2008-01-05 22:19:06 +00:00
Georg Brandl
f725b9587c Doc patch #1730 from Robin Stocker; minor corrections mostly to os.rst. 2008-01-05 19:44:22 +00:00
Andrew M. Kuchling
0589914e60 Fix comment typo 2008-01-05 15:13:49 +00:00
Jeffrey Yasskin
9871d8fe22 Continue rolling back pep-3141 changes that changed behavior from 2.5. This
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.
2008-01-05 08:47:13 +00:00
Fred Drake
f7476c4d46 clean up a comment 2008-01-05 04:38:38 +00:00
Raymond Hettinger
1b50fd7cb3 Add error-checking to namedtuple's _replace() method. 2008-01-05 02:17:24 +00:00
Raymond Hettinger
02740f73ff Improve namedtuple's _cast() method with a docstring, new name, and error-checking. 2008-01-05 01:35:43 +00:00
Guido van Rossum
ced4eb06e4 Patch #1698 by Senthil: allow '@' in username when parsed by urlparse.py. 2008-01-05 01:21:57 +00:00
Guido van Rossum
3b83549ea0 Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000
and adds errors for -0x.
2008-01-05 00:59:59 +00:00
Christian Heimes
a47b75b0a0 socket.ioctl is only available on Windows 2008-01-04 15:48:06 +00:00
Christian Heimes
04ae916fa2 Added interface to Windows' WSAIoctl and a simple example for a network sniffer. 2008-01-04 15:23:30 +00:00
Lars Gustäbel
2ee1c760cc Issue #1735: TarFile.extractall() now correctly sets
directory permissions and times.

(will backport to 2.5)
2008-01-04 14:00:33 +00:00
Christian Heimes
0687561c94 Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a mountpoint. 2008-01-04 13:21:07 +00:00
Jeffrey Yasskin
737c73f96f Make math.{floor,ceil}({int,long}) return float again for backwards
compatibility after r59671 made them return integral types.
2008-01-04 08:01:23 +00:00
Raymond Hettinger
e0734e7dc0 Minor fix-ups to named tuples:
* 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.
2008-01-04 03:22:53 +00:00
Christian Heimes
76d19f68e4 Added _struct._clearcache() for regression tests 2008-01-04 02:54:42 +00:00
Christian Heimes
f2f41ebef4 Fixed refleak tests for _struct changes 2008-01-04 02:46:19 +00:00