summaryrefslogtreecommitdiff
path: root/Include/Python.h
AgeCommit message (Collapse)AuthorLines
2018-01-24bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. ↵Miss Islington (bot)-0/+3
(GH-5284) (#5295) glibc is deprecating libcrypt in favor of libxcrypt, however python assumes that crypt.h will always be included. This change makes the header inclusion explicit when libxcrypt is present on the system. (cherry picked from commit e768c86ef442ef89004089a8a34ce5909ffb90f2)
2010-07-19Issue #9036: Throughout the code base, Py_CHARMASK is used on 8-bit wideStefan Krah-6/+1
signed/unsigned chars or on integers directly derived from those. In all cases, it could be replaced by a simple cast to (unsigned char). Reasons for the change: a) Make the comment more explicit. b) If char is unsigned, the cast is optimized away. c) If char is unsigned, gcc emits spurious "array subscript has type 'char'" warnings.
2010-03-25Backported PyCapsule from 3.1, and converted most uses ofLarry Hastings-0/+1
CObject to PyCapsule.
2009-10-24Issue #7117: Prepare for backport of py3k float repr.Mark Dickinson-0/+1
Add the Python/dtoa.c file containing the main algorithms; add corresponding include file and include in Python.h; include license information for Python/dtoa.c; add dtoa.c and dtoa.h to Makefile.
2009-04-27Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to ↵Eric Smith-0/+1
py3k. Should fix Windows buildbot errors.
2009-04-02Issue #2396: backport the memoryview object.Antoine Pitrou-1/+1
2008-06-11Correct an incorrect comment about our #include of stddef.h.Gregory P. Smith-1/+1
(see Doug Evans' comment on python-dev 2008-06-10)
2008-06-05Fix preprocessor statement.Thomas Heller-1/+2
2008-06-05MacOS X: Enable 4-way universal buildsRonald Oussoren-2/+2
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-05-26First step of the C API rename:Christian Heimes-0/+1
renamed Include/bytesobject.h to Include/bytearrayobject.h renamed Include/stringobject.h to Include/bytesobject.h added Include/stringobject.h with aliases
2008-04-18I finally got the time to update and merge Mark's and my trunk-math branch. ↵Christian Heimes-0/+1
The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
2008-04-12Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon-0/+1
'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
2008-03-28Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings.Neal Norwitz-1/+1
Rather than sprinkle casts throughout the code, change Py_CHARMASK to always cast it's result to an unsigned char. This should ensure we do the right thing when accessing an array with the result.
2008-03-26Merged revisions ↵Christian Heimes-0/+1
61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........
2008-03-18Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant-0/+1
object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
2007-12-18Applied patch #1635: Float patch for inf and nan on Windows (and other ↵Christian Heimes-0/+1
platforms). The patch unifies float("inf") and repr(float("inf")) on all platforms.
2006-06-10Patch #1495999: Part two of Windows CE changes.Martin v. Löwis-1/+1
- update header checks, using autoconf - provide dummies for getenv, environ, and GetVersion - adjust MSC_VER check in socketmodule.c
2006-05-22Patch #1492356: Port to Windows CE (patch set 1).Martin v. Löwis-0/+2
2005-12-17Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,Neal Norwitz-0/+1
simplifies a lot of error handling code, and fixes many memory leaks.
2005-10-20Merge ast-branch to headJeremy Hylton-2/+1
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
2004-07-27Use intptr_t/uintptr_t on WindowsMartin v. Löwis-0/+5
2004-06-27Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis-0/+1
2004-06-08Patch #774665: Make Python LC_NUMERIC agnostic.Martin v. Löwis-0/+2
2004-03-13compile.h and eval.h weren't being included which kept a fair bit of theSkip Montanaro-0/+3
public API from being exposed by simply including Python.h (as recommended).
2004-02-10remove support for missing ANSI C header files (limits.h, stddef.h, etc).Skip Montanaro-6/+0
2003-12-22Changed the UCHAR_MAX error msg a bit: we don't really assume anythingTim Peters-1/+1
about "characters", we assume something about C's char type (which is an integral type).
2003-12-22There are places in Python which assume bytes have 8-bits. Formalize that aSkip Montanaro-0/+8
bit by checking the value of UCHAR_MAX in Include/Python.h. There was a check in Objects/stringobject.c. Remove that. (Note that we don't define UCHAR_MAX if it's not defined as the old test did.)
2003-11-16* Migrate set() and frozenset() from the sandbox.Raymond Hettinger-0/+1
* 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.
2002-08-12Excise DL_EXPORT from Include.Mark Hammond-1/+1
Thanks to Skip Montanaro and Kalle Svensson for the patches.
2002-07-20Define _XOPEN_SOURCE and _GNU_SOURCE in pyconfig.h, to have themMartin v. Löwis-11/+0
available in the configure tests already.
2002-07-18Define _XOPEN_SOURCE in configure and Python.h.Jeremy Hylton-6/+1
This gets compilation of posixmodule.c to succeed on Tru64 and does no harm on Linux. We may need to undefine it on some platforms, but let's wait and see. Martin says: > I think it is generally the right thing to define _XOPEN_SOURCE on > Unix, providing a negative list of systems that cannot support this > setting (or preferably solving whatever problems remain). > > I'd put an (unconditional) AC_DEFINE into configure.in early on; it > *should* go into confdefs.h as configure proceeds, and thus be active > when other tests are performed.
2002-07-12HAVE_LIMITS_H -- raise #error if not defined; limits.h is std CTim Peters-0/+2
ULONG_MAX -- removed; std C requires it in limits.h LONGLONG_MAX -- removed; never used ULONGLONGMAX -- removed; never used
2002-07-07Removed WITH_CYCLE_GC #ifdef-ery. Holes:Tim Peters-0/+8
+ I'm not sure what to do about configure.in. Left it alone. + Ditto pyexpat.c. Fred or Martin will know what to do.
2002-06-20SF 569257 -- Name mangle double underscored variable names in __slots__.Raymond Hettinger-0/+4
2002-06-09Patch #505375: Make doc strings optional.Martin v. Löwis-0/+10
2002-06-04Patch #555929: Cygwin AH_BOTTOM cleanup patch (*** version 2 ***)Jason Tishler-8/+8
This patch complies with the following request found near the top of configure.in: # This is for stuff that absolutely must end up in pyconfig.h. # Please use pyport.h instead, if possible. I tested this patch under Cygwin, Win32, and Red Hat Linux. Python built and ran successfully on each of these platforms.
2002-05-27Silly typo.Michael W. Hudson-1/+1
2002-05-15Back out #555929Martin v. Löwis-2/+3
2002-05-15Patch #555929: Cygwin AH_BOTTOM cleanup patchJason Tishler-3/+2
This patch complies with the following request found near the top of configure.in: # This is for stuff that absolutely must end up in pyconfig.h. # Please use pyport.h instead, if possible. I tested this patch under Cygwin, Win32, and Red Hat Linux. Python built and ran successfully on each of these platforms.
2002-04-26- New builtin function enumerate(x), from PEP 279. Example:Guido van Rossum-0/+1
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c"). The argument can be an arbitrary iterable object.
2002-04-03Add the 'bool' type and its values 'False' and 'True', as described inGuido van Rossum-0/+1
PEP 285. Everything described in the PEP is here, and there is even some documentation. I had to fix 12 unit tests; all but one of these were printing Boolean outcomes that changed from 0/1 to False/True. (The exception is test_unicode.py, which did a type(x) == type(y) style comparison. I could've fixed that with a single line using issubtype(x, type(y)), but instead chose to be explicit about those places where a bool is expected. Still to do: perhaps more documentation; change standard library modules to return False/True from predicates.
2002-03-25Add a comment that PyArg_GetInt is deprecated and should not be usedNeal Norwitz-0/+1
2002-03-25Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.Neal Norwitz-0/+3
2002-03-23Give Python a debug-mode pymalloc, much as sketched on Python-Dev.Tim Peters-0/+9
When WITH_PYMALLOC is defined, define PYMALLOC_DEBUG to enable the debug allocator. This can be done independent of build type (release or debug). A debug build automatically defines PYMALLOC_DEBUG when pymalloc is enabled. It's a detected error to define PYMALLOC_DEBUG when pymalloc isn't enabled. Two debugging entry points defined only under PYMALLOC_DEBUG: + _PyMalloc_DebugCheckAddress(const void *p) can be used (e.g., from gdb) to sanity-check a memory block obtained from pymalloc. It sprays info to stderr (see next) and dies via Py_FatalError if the block is detectably damaged. + _PyMalloc_DebugDumpAddress(const void *p) can be used to spray info about a debug memory block to stderr. A tiny start at implementing "API family" checks isn't good for anything yet. _PyMalloc_DebugRealloc() has been optimized to do little when the new size is <= old size. However, if the new size is larger, it really can't call the underlying realloc() routine without either violating its contract, or knowing something non-trivial about how the underlying realloc() works. A memcpy is always done in this case. This was a disaster for (and only) one of the std tests: test_bufio creates single text file lines up to a million characters long. On Windows, fileobject.c's get_line() uses the horridly funky getline_via_fgets(), which keeps growing and growing a string object hoping to find a newline. It grew the string object 1000 bytes each time, so for a million-character string it took approximately forever (I gave up after a few minutes). So, also: fileobject.c, getline_via_fgets(): When a single line is outrageously long, grow the string object at a mildly exponential rate, instead of just 1000 bytes at a time. That's enough so that a debug-build test_bufio finishes in about 5 seconds on my Win98SE box. I'm curious to try this on Win2K, because it has very different memory behavior than Win9X, and test_bufio always took a factor of 10 longer to complete on Win2K. It *could* be that the endless reallocs were simply killing it on Win2K even in the release build.
2002-01-12Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis-0/+3
2001-12-04Stop defining NDEBUG in Python.h, because it can interfere withTim Peters-5/+4
extensions that #include Python.h. See (rejected) patch 487634 for more detail. I'll open a new bug report for the rest needed here.
2001-10-05Include the weakref object interface.Fred Drake-0/+1
2001-08-02Merge of descr-branch back into trunk.Tim Peters-0/+1
2001-07-26Repair more now-obsolete references to config.h.Tim Peters-1/+1
2001-07-26Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.Martin v. Löwis-1/+1