Commit Graph

362 Commits

Author SHA1 Message Date
Raymond Hettinger da614dcc4f Complete an open todo on pickletools -- add a pickle optimizer. 2008-02-10 20:35:16 +00:00
Mark Dickinson 3a94ee05f7 Typos in decimal comment and documentation 2008-02-10 15:19:58 +00:00
Raymond Hettinger 13a707577f Clarify that decimal also supports fixed-point arithmetic. 2008-02-10 07:21:09 +00:00
Nick Coghlan 97fac3eb0a Issue 2021: Allow NamedTemporaryFile and SpooledTemporaryFile to be used as context managers. (The NamedTemporaryFile fix should be considered for backporting to 2.5) 2008-02-09 15:28:09 +00:00
Raymond Hettinger 7e33663ec4 Add advice on choosing between DictMixin and MutableMapping 2008-02-08 23:57:06 +00:00
Raymond Hettinger 23bdcc9253 Fix typo 2008-02-07 20:10:49 +00:00
Raymond Hettinger ff1f97307d The float conversion recipe is simpler in Py2.6 2008-02-07 20:04:37 +00:00
Walter Dörwald a53800e02c Fix documentation for Calendar.iterweekdays(): firstweekday is a property.
Fixes second part of #2018.
2008-02-07 19:48:34 +00:00
Walter Dörwald 97bf449f75 Clarify that the output of TextCalendar.formatmonth() and
TextCalendar.formatyear() for custom instances won't be influenced by calls
to the module global setfirstweekday() function. Fixes #2018.
2008-02-07 19:30:22 +00:00
Mark Dickinson 00c2e65850 IEEE 754 should be IEEE 854; give precise reference for
comparisons involving NaNs.
2008-02-07 01:42:06 +00:00
Mark Dickinson ff6672fda1 Fix broken link in decimal documentation. 2008-02-07 01:14:23 +00:00
Mark Dickinson bafa9425a6 Remove incorrect usage of :const: in documentation. 2008-02-06 22:25:16 +00:00
Mark Dickinson 2fc9263df5 Issue 1979: Make Decimal comparisons (other than !=, ==) involving NaN
raise InvalidOperation (and return False if InvalidOperation is trapped).
2008-02-06 22:10:50 +00:00
Walter Dörwald c16c57c733 Remove month parameter from Calendar.yeardatescalendar(),
Calendar.yeardays2calendar() and Calendar.yeardayscalendar() as the methods
don't have such a parameter. Fixes issue #2017.

Rewrap content to 80 chars.
2008-02-06 14:31:55 +00:00
Skip Montanaro 3c0f309fd1 correct object name 2008-02-05 19:24:30 +00:00
Georg Brandl 1cf0522f26 Convert external links to internal links. Fixes #2010. 2008-02-05 12:01:24 +00:00
Christian Heimes 422051a367 Patch #1953
I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers.
The patch also renames sys._cleartypecache to sys._clear_type_cache
2008-02-04 18:00:12 +00:00
Brett Cannon 89dfbe35af Remove extra tick marks and add a missing closing parenthesis. 2008-02-03 02:34:14 +00:00
Georg Brandl bbc4fc2933 Add email example how to send a multipart message.
Written for GHOP by Martin Matejek.
2008-02-02 10:49:58 +00:00
Georg Brandl 586a57a43c Amendments to the urllib2 docs, written for GHOP by Thomas Lamb. 2008-02-02 09:56:20 +00:00
Georg Brandl 2a5d1c3493 Update IPv6 RFC number. 2008-02-01 11:59:08 +00:00
Jeffrey Yasskin ca2b69f765 Move __builtins__.trunc() to math.trunc() per
http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue
1965.
2008-02-01 06:22:46 +00:00
Jeffrey Yasskin b23dea6adb Added more documentation on how mixed-mode arithmetic should be implemented. I
also noticed and fixed a bug in Rational's forward operators (they were
claiming all instances of numbers.Rational instead of just the concrete types).
2008-01-31 07:44:11 +00:00
Raymond Hettinger a44327a9a2 Update itertool recipes 2008-01-30 22:17:31 +00:00
Christian Heimes 908caac52e Added clear cache methods to clear the internal type lookup cache for ref leak test runs. 2008-01-27 23:34:59 +00:00
Raymond Hettinger 9bba7b7085 Removed an unnecessary and confusing paragraph from the namedtuple docs. 2008-01-27 10:47:55 +00:00
Gregory P. Smith d006380fe1 Update docs for new callpack params added in r60188 2008-01-26 18:51:05 +00:00
Georg Brandl 0522548d61 Slashes allowed on Windows. 2008-01-26 11:02:22 +00:00
Georg Brandl fe7dd50907 #1934: fix os.path.isabs docs. 2008-01-26 09:43:35 +00:00
Vinay Sajip f38ba78d7d Added documentation for optional delay argument to FileHandler and subclasses. 2008-01-24 12:38:30 +00:00
Gregory P. Smith 7b7ce7854c Fix issue1789: The tutorial contained a misuse of the struct module.
(also remove an unneeded import struct from test_largefile)
2008-01-24 09:38:26 +00:00
Raymond Hettinger c226c31139 Let pprint() support sets and frozensets (suggested by David Mertz). 2008-01-23 00:04:40 +00:00
Raymond Hettinger 2dec48d1c5 Improve variable name in sample code 2008-01-22 22:09:26 +00:00
Raymond Hettinger 9ed5b57fe2 Give zip() the same guarantee as izip() for left-to-right evaluation. 2008-01-22 20:18:53 +00:00
Raymond Hettinger 48c6293500 Document when to use izip_longest(). 2008-01-22 19:51:41 +00:00
Vinay Sajip 733024a752 Minor documentation change - hyperlink tidied up. 2008-01-21 17:39:22 +00:00
Georg Brandl 0751d1ad2a Adapt pydoc to new doc URLs. 2008-01-21 17:13:03 +00:00
Georg Brandl f8dd5b393c Removing bundlebuilder docs again -- it's not to be used anymore (see #779825). 2008-01-21 16:46:58 +00:00
Georg Brandl d7e3e60b87 Add a stub for bundlebuilder documentation. 2008-01-21 16:36:00 +00:00
Georg Brandl 864de8274c #1555501: document plistlib and move it to the general library. 2008-01-21 16:34:07 +00:00
Georg Brandl 960b186eaf Fix example. 2008-01-21 16:28:13 +00:00
Georg Brandl 845c403c08 #1087741: make mmap.mmap the type of mmap objects, not a
factory function. Allow it to be subclassed.
2008-01-21 14:16:46 +00:00
Georg Brandl 5235398323 #1669: don't allow shutil.rmtree() to be called on a symlink. 2008-01-20 14:17:42 +00:00
Georg Brandl 56112895d6 #1648: add sys.gettrace() and sys.getprofile(). 2008-01-20 13:59:46 +00:00
Georg Brandl 92058d2933 #652749: document the constants added to the builtins by site.py. 2008-01-20 13:08:37 +00:00
Georg Brandl 440f2fff14 #799369: document possible sys.platform values. 2008-01-20 12:57:47 +00:00
Georg Brandl 2235011d49 #856047: respect the ``no_proxy`` env var when checking for proxies
in urllib and using the other ``_proxy`` env vars.
Original patch by Donovan Baarda.
2008-01-20 12:05:43 +00:00
Georg Brandl 9b0d46db11 #1178141: add addinfourl.code to get http status code from urllib. 2008-01-20 11:43:03 +00:00
Gregory P. Smith da407232e0 Document that zipfile decryption is insanely slow and fix a typo and
blatant lie in a docstring (it is not useful for security regardless of
how you spell it).
2008-01-20 01:32:00 +00:00
Andrew M. Kuchling 8b506e7a2d Bug 1296: restore text describing OptionGroup 2008-01-19 21:00:38 +00:00
Georg Brandl f558d2e5f5 #1509: fix sqlite3 docstrings and docs w.r.t. cursor.fetchXXX methods. 2008-01-19 20:53:07 +00:00
Georg Brandl e3979f776a #1411695: clarify behavior of xml.sax.utils.[un]escape. 2008-01-19 20:40:24 +00:00
Georg Brandl 309501a617 #1663329: add os.closerange() to close a range of fds,
ignoring errors, and use this in subprocess to speed up
subprocess creation in close_fds mode. Patch by Mike Klaas.
2008-01-19 20:22:13 +00:00
Facundo Batista 873c9857b7 Fix #1693149. Now you can pass several modules separated by
coma to trace.py in the same --ignore-module option.
Thanks Raghuram Devarakonda.
2008-01-19 18:38:19 +00:00
Andrew M. Kuchling 5c60bfcfbf Patch #976880: add mmap .rfind() method, and 'end' paramter to .find().
Contributed by John Lenton.
2008-01-19 18:18:41 +00:00
Georg Brandl 6ebc52749c Clarify thread.join() docs. #1873. 2008-01-19 17:38:53 +00:00
Andrew M. Kuchling e45a77adbe Patch #742598 from Michael Pomraning: add .timeout attribute to SocketServer that will call
.handle_timeout() method when no requests are received within the timeout period.
2008-01-19 16:26:13 +00:00
Andrew M. Kuchling f8f4eb69ce Polish sentence 2008-01-19 13:33:20 +00:00
Georg Brandl a7d70fd438 Amend curses docs by info how to write non-ascii characters.
Thanks to Jeroen Ruigrok van der Werven.
2008-01-19 10:16:09 +00:00
Georg Brandl f8e6afbb66 Fix markup. 2008-01-19 10:11:27 +00:00
Jeffrey Yasskin 45169fbc80 Several tweaks: add construction from strings and .from_decimal(), change
__init__ to __new__ to enforce immutability, and remove "rational." from repr
and the parens from str.
2008-01-19 09:56:06 +00:00
Raymond Hettinger 0fe6ca4673 Better variable name in an example. 2008-01-18 21:14:58 +00:00
Vinay Sajip c7403355df Added section on passing contextual information to logging and documentation for the LoggerAdapter class. 2008-01-18 15:54:14 +00:00
Andrew M. Kuchling 6d22c3961d Typo fix 2008-01-18 02:42:52 +00:00
Raymond Hettinger 64cd1e2d91 Fix markup 2008-01-17 23:56:56 +00:00
Raymond Hettinger 497fdbf767 Fix-up Timer() example. 2008-01-17 23:32:01 +00:00
Raymond Hettinger d0ab014b5e Add advice on choosing between scheduler and threading.Timer(). 2008-01-17 22:27:49 +00:00
Raymond Hettinger 44bd6c0a4f Issue #1861: Add read-only attribute listing upcoming events in the order they will be run. 2008-01-17 19:31:38 +00:00
Gregory P. Smith bde4ae4bde Fixes (accepts patch) issue1339 - http://bugs.python.org/issue1339
- Factor out the duplication of EHLO/HELO in login() and sendmail() to
  a new function, ehlo_or_helo_if_needed().
- Use ehlo_or_helo_if_needed() in starttls()
- Check for the starttls exception in starttls() in the same way as
  login() checks for the auth extension.
Contributed by Bill Fenner.
2008-01-17 08:35:49 +00:00
Raymond Hettinger d59f457279 Note versionadded. 2008-01-17 08:07:05 +00:00
Raymond Hettinger 473170908e Make starmap() match its pure python definition and accept any itertable input (not just tuples). 2008-01-17 03:02:14 +00:00
Raymond Hettinger 171f3916c5 Minor wordsmithing. 2008-01-16 23:38:16 +00:00
Georg Brandl 5c8b2abf71 Fix MSDN library URL. (#1854) 2008-01-16 16:56:29 +00:00
Andrew M. Kuchling 95f17bbfc0 Markup fix 2008-01-16 13:01:51 +00:00
Raymond Hettinger e805782b53 Fix-up half-written paragraph in the docs 2008-01-15 21:22:47 +00:00
Raymond Hettinger f59e962b49 Refactor if/elif chain for clarity and speed. Remove dependency on subclasses having to implement _empty and _full. 2008-01-15 20:52:42 +00:00
Jeffrey Yasskin d7b00334f3 Add rational.Rational as an implementation of numbers.Rational with infinite
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.
2008-01-15 07:46:24 +00:00
Raymond Hettinger 907cda6ebb Small grammar nit 2008-01-15 05:46:43 +00:00
Skip Montanaro f233b0c454 Better (?) text describing the lack of guarantees provided by qsize(),
empty() and full().
2008-01-15 03:40:20 +00:00
Andrew M. Kuchling f15ff46be5 Markup fix 2008-01-15 01:29:44 +00:00
Andrew M. Kuchling 7ce9b18460 Typo fixes 2008-01-15 01:29:16 +00:00
Christian Heimes c94e2b5c12 Now that I've learnt about structseq objects I felt like converting sys.float_info to a structseq. It's
readonly and help(sys.float_info) explains the attributes nicely.
2008-01-14 04:13:37 +00:00
Christian Heimes f31b69f9db Applied patch #1816: sys.flags patch 2008-01-14 03:42:48 +00:00
Georg Brandl 9f1e2ecb48 Clarify the effect of text mode. 2008-01-13 09:36:18 +00:00
Georg Brandl fca4e1ffa1 Fix editing glitch. 2008-01-12 16:11:09 +00:00
Georg Brandl 57fe0f2902 Move OSError docs to exceptions doc, remove obsolete descriptions
from os docs, rework posix docs.
2008-01-12 10:53:29 +00:00
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
Raymond Hettinger bed4dd459d Update the opcode docs for STORE_MAP and BUILD_MAP 2008-01-11 23:25:18 +00:00
Andrew M. Kuchling de68037202 Bug #1790: update link; remove outdated paragraph 2008-01-11 19:33:24 +00:00
Georg Brandl e3c3db59b5 Documentation for r5990[3567]. 2008-01-11 09:55:53 +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
Raymond Hettinger dc1854dec4 Fix typo 2008-01-09 03:13:20 +00:00
Raymond Hettinger e11230e11b Syntax highlighting only works when >>> lines are accompanied by ... lines 2008-01-09 03:02:23 +00:00
Georg Brandl 502d6312db Fix markup errors from r59857 and clarify key.__enter__/__exit__ docs 2008-01-08 16:18:26 +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