summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Whether platform malloc(0) returns NULL has nothing to do with whetherTim Peters2002-03-022-9/+22
| | | | | | | | | | | platform realloc(p, 0) returns NULL, so MALLOC_ZERO_RETURNS_NULL can be correctly undefined yet realloc(p, 0) can return NULL anyway. Prevent realloc(p, 0) doing free(p) and returning NULL via a different hack. Would probably be better to get rid of MALLOC_ZERO_RETURNS_NULL entirely. Bugfix candidate.
* For clarity, change _longobject to build directly from PyObject_VAR_HEADTim Peters2002-03-021-3/+6
| | | | | instead of faking it by hand. It *is* a var object, and nothing but hysterical raisins to pretend it's an oddball.
* Cells are not VAR objects.Jeremy Hylton2002-02-281-1/+1
| | | | | | Noted by Jason Orendorff, SF #520768. Bug fix candidate for 2.1 & 2.2.
* PyGC_Head: Use "long double" instead of "double" as the worst-caseTim Peters2002-02-281-1/+1
| | | | | | | alignment gimmick. David Abrahams notes that the standard "long double" actually requires stricter alignment than "double" on some Tru64 box. On my box and yours <wink>, it's the same, so no harm done on most boxes.
* OS/2 EMX port changes (Include part of patch #450267):Andrew MacIntyre2002-02-262-0/+9
| | | | | | Include/ osdefs.h // EMX promotes Un*x path separators pyport.h
* Change the version string from "2.2+" to "2.3a0". disutils peels offTim Peters2002-02-021-1/+1
| | | | | | the first 3 characters of this string in several places, so for as long as they remain "2.2" it confuses the heck out of attempts to build 2.3 stuff using distutils.
* Got rid of a few more NeXT ifdefs. The last, I think.Jack Jansen2002-02-011-2/+1
|
* Remove the unused & broken PyThread_*_sema() functions and related constants.Fred Drake2002-01-191-7/+0
| | | | This closes SF patch #504215.
* Patch #477752: Drop old-style getargs from curses.Martin v. Löwis2002-01-171-16/+7
|
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-0/+3
|
* Implement PyObject_DelItemString. Fixes #498915.Martin v. Löwis2002-01-051-0/+8
|
* Patch #494783: Rename cmp_op enumerators.Martin v. Löwis2002-01-011-3/+3
|
* SF bug #495548: troublesome #define in pyport.hTim Peters2001-12-251-1/+0
| | | | | | | | | Removed the ancient "#define ANY void". Bugfix candidate? Hard call. The bug report claims the existence of this #define creates conflicts with other packages, which is easy to believe. OTOH, some extension authors may still be relying on its presence. I'm afraid you can't win on this one.
* And we start all over again!Barry Warsaw2001-12-211-3/+3
|
* As usual, bump the version number.Barry Warsaw2001-12-141-3/+3
|
* Add helper macro to get the number of free variables for a PyCodeObject.Jeremy Hylton2001-12-131-0/+1
|
* SF bug #491415 PyDict_UpdateFromSeq2() unusedTim Peters2001-12-111-1/+19
| | | | | | | PyDict_UpdateFromSeq2(): removed it. PyDict_MergeFromSeq2(): made it public and documented it. PyDict_Merge() docs: updated to reveal <wink> that the second argument can be any mapping object.
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-1/+1
| | | | | | | | | | | | | type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
* PyMethodObject(): Update the comment about im_class based upon aGuido van Rossum2001-12-071-1/+1
| | | | conversation with Robin Dunn in SF patch #490402.
* SF bug #488514: -Qnew needs workTim Peters2001-12-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big Hammer to implement -Qnew as PEP 238 says it should work (a global option affecting all instances of "/"). pydebug.h, main.c, pythonrun.c: define a private _Py_QnewFlag flag, true iff -Qnew is passed on the command line. This should go away (as the comments say) when true division becomes The Rule. This is deliberately not exposed to runtime inspection or modification: it's a one-way one-shot switch to pretend you're using Python 3. ceval.c: when _Py_QnewFlag is set, treat BINARY_DIVIDE as BINARY_TRUE_DIVIDE. test_{descr, generators, zipfile}.py: fiddle so these pass under -Qnew too. This was just a matter of s!/!//! in test_generators and test_zipfile. test_descr was trickier, as testbinop() is passed assumptions that "/" is the same as calling a "__div__" method; put a temporary hack there to call "__truediv__" instead when the method name is "__div__" and 1/2 evaluates to 0.5. Three standard tests still fail under -Qnew (on Windows; somebody please try the Linux tests with -Qnew too! Linux runs a whole bunch of tests Windows doesn't): test_augassign test_class test_coercion I can't stay awake longer to stare at this (be my guest). Offhand cures weren't obvious, nor was it even obvious that cures are possible without major hackery. Question: when -Qnew is in effect, should calls to __div__ magically change into calls to __truediv__? See "major hackery" at tail end of last paragraph <wink>.
* Stop defining NDEBUG in Python.h, because it can interfere withTim Peters2001-12-041-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.
* Fix SF bug #486144: Uninitialized __slot__ vrbl is None.Guido van Rossum2001-12-041-0/+4
| | | | | | | There's now a new structmember code, T_OBJECT_EX, which is used for all __slot__ variables (except __weakref__, which has special behavior anyway). This new code raises AttributeError when the variable is NULL rather than converting NULL to None.
* mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, toTim Peters2001-12-031-5/+0
| | | | | | | | | | | | | | | use wrappers on all platforms, to make this as consistent as possible x- platform (in particular, make sure there's at least one \0 byte in the output buffer). Also document more of the truth about what these do. getargs.c, seterror(): Three computations of remaining buffer size were backwards, thus telling PyOS_snprintf the buffer is larger than it actually is. This matters a lot now that PyOS_snprintf ensures there's a trailing \0 byte (because it didn't get the truth about the buffer size, it was storing \0 beyond the true end of the buffer). sysmodule.c, mywrite(): Simplify, now that PyOS_vsnprintf guarantees to produce a \0 byte.
* PyFile_WriteString(): change prototype so that the string arg isTim Peters2001-11-281-1/+1
| | | | | | const char* instead of char*. The change is conceptually correct, and indirectly fixes a compiler wng introduced when somebody else innocently passed a const char* to this function.
* Removed preprocessor gimmick trying to force use of snprintf emulationTim Peters2001-11-281-8/+6
| | | | before 2.2b1.
* Fix SF bug [ #476852 ] Some bad macros in abstract.hJeremy Hylton2001-11-281-2/+2
| | | | Change macros as requested by Guido
* Bumping version number.Barry Warsaw2001-11-161-2/+2
|
* Add PyObject_CheckReadBuffer(), which returns true if its argumentJeremy Hylton2001-11-091-0/+9
| | | | | | supports the single-segment readable buffer interface. Add documentation for this and other PyObject_XXXBuffer() calls.
* Make the CoreFoundation object _New and _Convert routines available to other ↵Jack Jansen2001-11-051-0/+24
| | | | modules. Idea by Donovan Preston, implementaion by me.
* PyObject_CallFunctionObArgs() ---> PyObject_CallFunctionObjArgs()Fred Drake2001-10-281-4/+4
| | | | PyObject_CallMethodObArgs() ---> PyObject_CallMethodObjArgs()
* SF patch #475657 (Dietmar Schwertberger)Guido van Rossum2001-10-271-3/+4
| | | | | | | | | | | | RISCOS/Makefile: include structseq and weakrefobject; changes to keep command line length below 2048 RISCOS/Modules/riscosmodule.c: typos from the stat structseq patch Include/pyport.h: don't re-#define __attribute__(__x) on RISC OS as it is already defined in c library
* SF bug #475327: type() produces incorrect error msgTim Peters2001-10-271-0/+1
| | | | | | | | | | | | | object.h: Added PyType_CheckExact macro. typeobject.c, type_new(): + Use the new macro. + Assert that the arguments have the right types rather than do incomplete runtime checks "sometimes". + If this isn't the 1-argument flavor() of type, and there aren't 3 args total, produce a "types() takes 1 or 3 args" msg before PyArg_ParseTupleAndKeywords produces a "takes exactly 3" msg.
* Added two new functions to conveniently call functions/methods from C.Fred Drake2001-10-261-5/+23
| | | | | | | PyObject_CallFunctionObArgs() and PyObject_CallMethodObArgs() have the advantage that no format strings need to be parsed. The CallMethod variant also avoids creating a new string object in order to retrieve a method from an object as well.
* Generalize dictionary() to accept a sequence of 2-sequences. At theTim Peters2001-10-261-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | outer level, the iterator protocol is used for memory-efficiency (the outer sequence may be very large if fully materialized); at the inner level, PySequence_Fast() is used for time-efficiency (these should always be sequences of length 2). dictobject.c, new functions PyDict_{Merge,Update}FromSeq2. These are wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2- sequences argument instead of a mapping object. For now, I left these functions file static, so no corresponding doc changes. It's tempting to change dict.update() to allow a sequence-of-2-seqs argument too. Also changed the name of dictionary's keyword argument from "mapping" to "x". Got a better name? "mapping_or_sequence_of_pairs" isn't attractive, although more so than "mosop" <wink>. abstract.h, abstract.tex: Added new PySequence_Fast_GET_SIZE function, much faster than going thru the all-purpose PySequence_Size. libfuncs.tex: - Document dictionary(). - Fiddle tuple() and list() to admit that their argument is optional. - The long-winded repetitions of "a sequence, a container that supports iteration, or an iterator object" is getting to be a PITA. Many months ago I suggested factoring this out into "iterable object", where the definition of that could include being explicit about generators too (as is, I'm not sure a reader outside of PythonLabs could guess that "an iterator object" includes a generator call). - Please check my curly braces -- I'm going blind <0.9 wink>. abstract.c, PySequence_Tuple(): When PyObject_GetIter() fails, leave its error msg alone now (the msg it produces has improved since PySequence_Tuple was generalized to accept iterable objects, and PySequence_Tuple was also stomping on the msg in cases it shouldn't have even before PyObject_GetIter grew a better msg).
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-241-0/+4
|
* Check for HP/UX curses problems. Define _XOPEN_SOURCE_EXTENDED andMartin v. Löwis2001-10-241-0/+11
| | | | | | STRICT_SYSV_CURSES when compiling curses module on HP/UX. Generalize access to _flags on systems where WINDOW is opaque. Fixes bugs #432497, #422265, and the curses parts of #467145 and #473150.
* Oops, undo previous change, which wasn't supposed to escape from myJack Jansen2001-10-241-1/+1
| | | | | machine. Luckily everyone is asleep, so I didn't have to use the time machine.
* Tweaks for MacPython 2.2b1Jack Jansen2001-10-231-1/+1
|
* PyArg_UnpackTuple(): New argument unpacking function suggested by JimFred Drake2001-10-231-0/+1
| | | | Fulton, based on code Jim supplied.
* Add function attributes that allow GCC to check the arguments of printf-likeNeil Schemenauer2001-10-234-9/+18
| | | | functions.
* Hide GCC attributes fom compilers that don't support them.Neil Schemenauer2001-10-231-0/+9
|
* Methods of built-in types now properly check for keyword argumentsGuido van Rossum2001-10-221-0/+7
| | | | | (formerly these were silently ignored). The only built-in methods that take keyword arguments are __call__, __init__ and __new__.
* Big internal change that should have no external effects: unify theGuido van Rossum2001-10-211-0/+3
| | | | | | | | | 'slotdef' structure typedef and 'struct wrapperbase'. By adding the wrapper docstrings to the slotdef structure, the slotdefs array can serve as the data structure that drives add_operators(); the wrapper descriptor contains a pointer to slotdef structure. This replaces lots of custom code from add_operators() by a loop over the slotdefs array, and does away with all the tab_xxx tables.
* Updated version numbers for post 2.2b1 development.Barry Warsaw2001-10-191-3/+3
|
* SF patch #470578: Fixes to synchronize unicode() and str()Guido van Rossum2001-10-191-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements what we have discussed on python-dev late in September: str(obj) and unicode(obj) should behave similar, while the old behaviour is retained for unicode(obj, encoding, errors). The patch also adds a new feature with which objects can provide unicode(obj) with input data: the __unicode__ method. Currently no new tp_unicode slot is implemented; this is left as option for the future. Note that PyUnicode_FromEncodedObject() no longer accepts Unicode objects as input. The API name already suggests that Unicode objects do not belong in the list of acceptable objects and the functionality was only needed because PyUnicode_FromEncodedObject() was being used directly by unicode(). The latter was changed in the discussed way: * unicode(obj) calls PyObject_Unicode() * unicode(obj, encoding, errors) calls PyUnicode_FromEncodedObject() One thing left open to discussion is whether to leave the PyUnicode_FromObject() API as a thin API extension on top of PyUnicode_FromEncodedObject() or to turn it into a (macro) alias for PyObject_Unicode() and deprecate it. Doing so would have some surprising consequences though, e.g. u"abc" + 123 would turn out as u"abc123"... [Marc-Andre didn't have time to check this in before the deadline. I hope this is OK, Marc-Andre! You can still make changes and commit them on the trunk after the branch has been made, but then please mail Barry a context diff if you want the change to be merged into the 2.2b1 release branch. GvR]
* SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.Guido van Rossum2001-10-181-0/+39
| | | | | | | | | | | | | | | | | This is a big one, touching lots of files. Some of the platforms aren't tested yet. Briefly, this changes the return value of the os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the time functions localtime(), gmtime(), and strptime() from tuples into pseudo-sequences. When accessed as a sequence, they behave exactly as before. But they also have attributes like st_mtime or tm_year. The stat return value, moreover, has a few platform-specific attributes that are not available through the sequence interface (because everybody expects the sequence to have a fixed length, these couldn't be added there). If your platform's struct stat doesn't define st_blksize, st_blocks or st_rdev, they won't be accessible from Python either. (Still missing is a documentation update.)
* Partial patch from SF #452266, by Jason Petrone.Guido van Rossum2001-10-161-1/+1
| | | | | | This changes Pythread_start_thread() to return the thread ID, or -1 for an error. (It's technically an incompatible API change, but I doubt anyone calls it.)
* Get rid of __defined__ and tp_defined -- there's no need toGuido van Rossum2001-10-151-1/+1
| | | | | distinguish __dict__ and __defined__ any more. In the C structure, tp_cache takes its place -- but this hasn't been implemented yet.
* Completely get rid of __dynamic__ and the correspondingGuido van Rossum2001-10-151-3/+0
| | | | | Py_TPFLAGS_DYNAMICTYPE bit. There is no longer a performance benefit, and I don't really see the use case any more.
* Use an assert() for the REQ() macro instead of making up our ownGuido van Rossum2001-10-151-10/+1
| | | | assertion.