Commit Graph

39656 Commits

Author SHA1 Message Date
Georg Brandl 5f27af055b X-ref to numbers module. 2008-06-07 18:16:12 +00:00
Georg Brandl afd05da314 Backport docs for abc module to 2.6. 2008-06-07 17:11:00 +00:00
Georg Brandl 60fbf7f8bb #3057: Fix the MutableMapping ABC to use the 2.6 dict interface. 2008-06-07 17:03:28 +00:00
Georg Brandl 3bed4aeea5 Register IterableUserDict as a MutableMapping. 2008-06-07 16:16:12 +00:00
Georg Brandl bf0610a1ca Revert unwanted changes. 2008-06-07 16:04:01 +00:00
Georg Brandl 7be19aabe2 Factor out docstring dedenting from inspect.getdoc() into inspect.cleandoc()
to ease standalone use of the algorithm.
2008-06-07 15:59:10 +00:00
Facundo Batista 6a5a177cba Finished bug #2451. Fixed the retrying part to make it
more robust.
2008-06-07 13:36:36 +00:00
Travis E. Oliphant 0144f27602 Remove locking part of new buffer protocol. 2008-06-06 22:39:47 +00:00
Travis E. Oliphant 711c9e954e Add long double check support to configure test. 2008-06-06 22:33:21 +00:00
Raymond Hettinger ec2fe78d47 Issue 3501: Make heapq support both __le__ and __lt__. 2008-06-06 21:47:51 +00:00
Ronald Oussoren 0d236eb05a Fix build issue on OSX 10.4 2008-06-06 21:31:33 +00:00
Thomas Heller 3f67c43f78 Document the new ctypes features.
It would be great if someone could review both sematics, markup, and
spelling, and correct the versionadded and versionchanges markers.
2008-06-06 20:05:15 +00:00
Thomas Heller fb0117e9d5 Add a reminder for the maintainer of whatsnew. 2008-06-06 18:42:11 +00:00
Thomas Heller f89b04c164 Performance improvement: Use PyDict_Get/SetItem instead of
PyDict_Get/SetItemString.
2008-06-06 18:37:55 +00:00
Georg Brandl d82a9c1618 Fix brackets. 2008-06-06 10:43:43 +00:00
Thomas Heller fbb9c0bf3c Issue #1798: Add ctypes calling convention that allows safe access of errno.
ctypes maintains thread-local storage that has space for two error
numbers: private copies of the system 'errno' value and, on Windows,
the system error code accessed by the GetLastError() and
SetLastError() api functions.

Foreign functions created with CDLL(..., use_errno=True), when called,
swap the system 'errno' value with the private copy just before the
actual function call, and swapped again immediately afterwards.  The
'use_errno' parameter defaults to False, in this case 'ctypes_errno'
is not touched.

On Windows, foreign functions created with CDLL(...,
use_last_error=True) or WinDLL(..., use_last_error=True) swap the
system LastError value with the ctypes private copy.

The values are also swapped immeditately before and after ctypes
callback functions are called, if the callbacks are constructed using
the new optional use_errno parameter set to True: CFUNCTYPE(...,
use_errno=TRUE) or WINFUNCTYPE(..., use_errno=True).

New ctypes functions are provided to access the ctypes private copies
from Python:

- ctypes.set_errno(value) and ctypes.set_last_error(value) store
  'value' in the private copy and returns the previous value.

- ctypes.get_errno() and ctypes.get_last_error() returns the current
  ctypes private copies value.
2008-06-06 08:33:46 +00:00
Georg Brandl d77554fe8c Markup fix. 2008-06-06 07:34:50 +00:00
Neal Norwitz 2a3e3d0446 Aldo Cortesi confirmed this is still needed for OpenBSD 4.2 and 4.3.
(I didn't regen configure, since I don't have a working autoconf.)
2008-06-06 04:47:01 +00:00
Andrew M. Kuchling 5e3e6ba81d Grammar fix 2008-06-05 23:35:48 +00:00
Andrew M. Kuchling b5a40dd224 Add various items 2008-06-05 23:35:31 +00:00
Andrew M. Kuchling 6dd8ccab2c Document 'utc' parameter 2008-06-05 23:33:54 +00:00
Benjamin Peterson 8456f64ce2 revert 63965 for preformance reasons 2008-06-05 23:02:33 +00:00
Benjamin Peterson 30dc7b8ce2 use the more idomatic while True 2008-06-05 22:39:34 +00:00
Thomas Heller 59475e9739 Backport from py3k: Implement the new buffer interface from pep3118
for ctypes instances.  Closes issue #2404.
2008-06-05 17:52:59 +00:00
Thomas Heller 2e75c450d2 Backport from py3k: Implement the new buffer interface from pep3118
for ctypes instances.  Closes issue #2404.
2008-06-05 17:51:15 +00:00
Thomas Heller 259a566ac5 Fix preprocessor statement. 2008-06-05 17:29:38 +00:00
Ronald Oussoren 5640ce2f1e MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX:
        --with-universal-archs=[32-bit|64-bit|all]

When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).

This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.

I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
2008-06-05 12:58:24 +00:00
Alexandre Vassalotti 80af6da748 Fixed complex.__getnewargs__() to not emit another complex object. 2008-06-04 20:41:44 +00:00
Thomas Heller d5bb9215c9 Revert revisions 63943 and 63942 (Issue #1798: Add ctypes calling
convention that allows safe access to errno)

This code does not yet work on OS X (__thread storage specifier not
available), so i needs a configure check plus a more portable
solution.
2008-06-04 20:22:05 +00:00
Thomas Heller 8f22b88e28 Fix ctypes.set_errno for gcc. 2008-06-04 19:19:00 +00:00
Thomas Heller e70c3378c0 Issue #1798: Add ctypes calling convention that allows safe access to
errno (and LastError, on Windows).

ctypes maintains a module-global, but thread-local, variable that
contains an error number; called 'ctypes_errno' for this discussion.
This variable is a private copy of the systems 'errno' value; the copy
is swapped with the 'errno' variable on several occasions.

Foreign functions created with CDLL(..., use_errno=True), when called,
swap the values just before the actual function call, and swapped
again immediately afterwards.  The 'use_errno' parameter defaults to
False, in this case 'ctypes_errno' is not touched.

The values are also swapped immeditately before and after ctypes
callback functions are called, if the callbacks are constructed using
the new optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE)
or WINFUNCTYPE(..., use_errno=True).

Two new ctypes functions are provided to access the 'ctypes_errno'
value from Python:

- ctypes.set_errno(value) sets ctypes_errno to 'value', the previous
  ctypes_errno value is returned.

- ctypes.get_errno() returns the current ctypes_errno value.

---

On Windows, the same scheme is implemented for the error value which
is managed by the GetLastError() and SetLastError() windows api calls.

The ctypes functions are 'ctypes.set_last_error(value)' and
'ctypes.get_last_error()', the CDLL and WinDLL optional parameter is
named 'use_last_error', defaults to False.

---

On Windows, TlsSetValue and TlsGetValue calls are used to provide
thread local storage for the variables; ctypes compiled with __GNUC__
uses __thread variables.
2008-06-04 18:59:03 +00:00
Georg Brandl a2b34b87a9 Complete revision of new turtle module's docs. 2008-06-04 11:17:26 +00:00
Martin v. Löwis 8718459f0f Patch #1513695: New turtle module, with demos. 2008-06-04 06:29:55 +00:00
Georg Brandl 4ed3ed13c5 Fix Tkinter sequence passing. #2906. 2008-06-03 10:23:15 +00:00
Benjamin Peterson c5393c64b8 make test_mutex more elegant 2008-06-03 01:30:37 +00:00
Walter Dörwald a2a89a8712 Change all functions that expect one unicode character to accept a pair of
surrogates in narrow builds. Fixes issue #1706460.
2008-06-02 20:36:03 +00:00
Thomas Heller 261b136321 Fix the -x flag so that is does work. 2008-06-02 20:07:46 +00:00
Thomas Heller de2d78a153 Fix misspelled sys.platform name and misspelled filename. 2008-06-02 18:41:30 +00:00
Martin v. Löwis ffe62ed46d Patch #2125: Add GetInteger and GetString methods for
msilib.Record objects.
2008-06-02 08:40:06 +00:00
Gregory P. Smith 137d824148 Fix issue 2782: be less strict about the format string type in strftime.
Accept unicode and anything else ParseTuple "s#" can deal with.  This
matches the time.strftime behavior.
2008-06-02 04:05:52 +00:00
Gregory P. Smith 8856ddae25 Adds a Thread.getIdent() method to provide the _get_ident() value for
any given threading.Thread object.  feature request issue 2871.
2008-06-01 23:48:47 +00:00
Gregory P. Smith 1bd52d745b Make the _H #define's match the header file names. Fix comments to
mention the correct type names.
2008-06-01 22:57:47 +00:00
Georg Brandl ac19d85e04 Deprecate htmllib and sgmllib for 3.0. 2008-06-01 21:19:14 +00:00
Georg Brandl 681001e11b Generate pydoc's topic help from the reST docs via Sphinx'
new text writer.
2008-06-01 20:33:55 +00:00
Georg Brandl 0b9aaa98a0 Spaces vs. tabs. 2008-06-01 19:24:36 +00:00
Benjamin Peterson c49372b080 add a warning about bgen being removed 2008-06-01 19:01:25 +00:00
Robert Schuppenies 9359afff56 Fix test_sys. 2008-06-01 17:11:09 +00:00
Georg Brandl 12f8107f91 Fix test_descrtut. 2008-06-01 17:05:56 +00:00
Georg Brandl 7a6de8b0f4 Some style nits. Also clarify in the docstrings what __sizeof__ does. 2008-06-01 16:42:16 +00:00
Georg Brandl 4f2c998ca9 Add plain text make target. 2008-06-01 16:41:31 +00:00