Commit graph

22115 commits

Author SHA1 Message Date
Fred Drake
63e40a598d Do not use PyModule_GetDict().
Clean up the example of exporting a C-callable API from an extension module.
Add a hyperlink to a related section in the Python/C API reference.
2002-04-12 19:08:31 +00:00
Fred Drake
e77e5ef2af Change example of retrieving & calling a Python function to not use
PyModule_GetDict(), which is also more flexible: it does not assume that the
"module" is a real module.
2002-04-12 19:04:17 +00:00
Fred Drake
292da58a5c Change the type of the tp_dealloc back to what it really is.
Change a section title to fit in better.
2002-04-12 18:28:08 +00:00
Martin v. Löwis
9701732782 Bump AC_PREREQ to 2.53. 2002-04-12 17:25:21 +00:00
Guido van Rossum
d854f3b3cc I am mad. This test never worked!
The test function's signature should be

    test(methodname, input, output, *args)

but the output argument was omitted.  This caused all tests to fail,
because the expected output was passed as the initial argument to the
method call.  But because of the way the test works (it compares the
results for a regular string to the results for a UserString instance
with the same value, and it's OK if both raise the same exception) the
test never failed!

I've fixed this, and also cleaned up a few warts in the verbose
output.  Finally, I've made it possible to run the test stand-alone in
verbose mode by passing -v as a command line argument.

Now, the test will report failure related to zfill.  That's not my
fault, that's a legitimate problem: the string_tests.py file contains
a test for the zfill() method (just added) but this method is not
implemented.  The responsible party will surely fix this soon now.
2002-04-12 16:25:39 +00:00
Fred Drake
ee48519bc6 Modernize the minimal example of an extension type. 2002-04-12 16:17:06 +00:00
Fred Drake
28de8d4b37 Add a (very) simple description of PyType_Ready(). 2002-04-12 16:15:10 +00:00
Fred Drake
0babc44ab2 Update the type of tp_dealloc. 2002-04-12 15:37:43 +00:00
Neal Norwitz
263ad28be9 Spell Raymond Hettinger's name write 2002-04-12 15:18:22 +00:00
Guido van Rossum
b69844ff72 Add Raymond Hettinger, CPA. 2002-04-12 15:12:47 +00:00
Guido van Rossum
e027d9818f Add Raymond Hettinger's d.pop(). See SF patch 539949. 2002-04-12 15:11:59 +00:00
Jack Jansen
ededa90f67 - Added support for inherent pointer types (typedefs of arrays)
- Added a debug class variable to enable parser debugging.
2002-04-12 13:21:49 +00:00
Jack Jansen
da70485694 Give type name when complaining about using input-only type for output
or v.v.
2002-04-12 13:14:54 +00:00
Martin v. Löwis
0036cbae58 Remove acconfig.h. 2002-04-12 09:58:45 +00:00
Martin v. Löwis
0b6964b569 Remove unused macros. 2002-04-12 09:55:28 +00:00
Martin v. Löwis
1143799df9 Update to autoconf 2.5x. 2002-04-12 09:54:03 +00:00
Tim Peters
85cc1c4368 _PyObject_DebugRealloc(): rewritten to let the underlying realloc do
most of the work.  In particular, if the underlying realloc is able to
grow the memory block in place, great (this routine used to do a fresh
malloc + memcpy every time a block grew).  BTW, I'm not so keen here on
avoiding possible quadratic-time realloc patterns as I am on making
the debug pymalloc more invisible (the more it uses memory "just like"
the underlying allocator, the better the chance that a suspected memory
corruption bug won't vanish when the debug malloc is turned on).
2002-04-12 08:52:50 +00:00
Tim Peters
f539c68ccd _PyObject_DebugDumpAddress(): clarify an output message. 2002-04-12 07:43:07 +00:00
Tim Peters
f6fb501c57 PYMALLOC_{CLEAN, DEAD, FORBIDDEN}BYTE symbols: remove the PYMALLOC_
prefix.  These symbols are private to the file, and the PYMALLOC_ gets
in the way (overly long code lines, comments, and error messages).
2002-04-12 07:38:53 +00:00
Tim Peters
af3e8de580 First stab at rationalizing the PyMem_ API. Mixing PyObject_xyz with
PyMem_{Del, DEL} doesn't work yet (compilation problems).

pyport.h:  _PyMem_EXTRA is gone.

pmem.h:  Repaired comments.  PyMem_{Malloc, MALLOC} and
PyMem_{Realloc, REALLOC} now make the same x-platform guarantees when
asking for 0 bytes, and when passing a NULL pointer to the latter.

object.c:  PyMem_{Malloc, Realloc} just call their macro versions
now, since the latter take care of the x-platform 0 and NULL stuff
by themselves now.

pypcre.c, grow_stack():  So sue me.  On two lines, this called
PyMem_RESIZE to grow a "const" area.  It's not legit to realloc a
const area, so the compiler warned given the new expansion of
PyMem_RESIZE.  It would have gotten the same warning before if it
had used PyMem_Resize() instead; the older macro version, but not the
function version, silently cast away the constness.  IMO that was a wrong
thing to do, and the docs say the macro versions of PyMem_xyz are
deprecated anyway.  If somebody else is resizing const areas with the
macro spelling, they'll get a warning when they recompile now too.
2002-04-12 07:22:56 +00:00
Tim Peters
e9e7452505 First cut at repairing out-of-date comments; make alignment of macro defs
all the same within the #ifdef WITH_PYMALLOC block.
2002-04-12 05:21:34 +00:00
Neil Schemenauer
d2560cd37c Move PyObject_Malloc and PyObject_Free here from object.c. Remove
PyMalloc_ prefix and use PyObject_ instead.  I'm not sure about the
debugging functions.  Perhaps they should stay as PyMalloc_.
2002-04-12 03:10:20 +00:00
Neil Schemenauer
bdf0eedb68 Move PyObject_Malloc and PyObject_Free to obmalloc.c. 2002-04-12 03:08:42 +00:00
Neil Schemenauer
58aa861fa2 Remove PyMalloc_*. 2002-04-12 03:07:20 +00:00
Neil Schemenauer
09a2ae5882 Change signature of _PyObject_GC_Malloc to match PyObject_MALLOC.
PyObject_Del and PyObject_GC_Del can now be used as a function
designators.
2002-04-12 03:06:53 +00:00
Neil Schemenauer
626d774df6 PyObject_GC_Del can now be used as a function designator. 2002-04-12 03:05:52 +00:00
Neil Schemenauer
7465ad2fc9 Remove PyMalloc_New and PyMalloc_Del. 2002-04-12 03:05:37 +00:00
Neil Schemenauer
510492e985 Remove PyMalloc_New, _PyMalloc_MALLOC, and PyMalloc_Del. 2002-04-12 03:05:19 +00:00
Neil Schemenauer
9acae5a0a6 Remove PyMalloc_New and PyMalloc_Del. 2002-04-12 02:44:55 +00:00
Neil Schemenauer
99b5d28467 PyObject_GC_Del can now be used as a function designator. 2002-04-12 02:44:22 +00:00
Neil Schemenauer
aa769ae468 PyObject_Del can now be used as a function designator. 2002-04-12 02:44:10 +00:00
Neil Schemenauer
6189b89cc5 PyObject_GC_Del and PyObject_Del can now be used as a function
designators.

Remove PyMalloc_New.
2002-04-12 02:43:00 +00:00
Neil Schemenauer
fec4eb1be1 Allow PyObject_Del to be used as a function designator. Provide binary
compatibility function.

Make PyObject_GC_Track and PyObject_GC_UnTrack functions instead of
trivial macros wrapping functions.  Provide binary compatibility
functions.
2002-04-12 02:41:03 +00:00
Neil Schemenauer
20d0a1a071 Remove PyMalloc_* symbols. PyObject_Malloc now uses pymalloc if
it's enabled.
2002-04-12 02:39:18 +00:00
Neil Schemenauer
3e7b893899 Remove PyMalloc_* symbols. PyObject_Malloc now uses pymalloc if
it's enabled.

Allow PyObject_Del, PyObject_Free, and PyObject_GC_Del to be used as
function designators.  Provide source compatibility macros.

Make PyObject_GC_Track and PyObject_GC_UnTrack functions instead of
trivial macros wrapping functions.
2002-04-12 02:38:45 +00:00
Neil Schemenauer
f6d1ea1749 Change the type of the tp_free from 'destructor' to 'freefunc'. 2002-04-12 01:57:06 +00:00
Tim Peters
2bbdba3c00 Removed more hair in support of future-generator stmts. 2002-04-12 01:20:10 +00:00
Jack Jansen
68c7e26dc9 Get rid of backward compatibility modules. Do this fairly early in the 2.3 cycle so we don't shoot ourselves in the foot later. 2002-04-11 21:03:37 +00:00
Fred Drake
04a8da5cdb Clean up the "all" support for -u. 2002-04-11 20:58:54 +00:00
Fred Drake
f9ddec41ce Guido sez to remove the deprecation warning for a year.
The deprecation is now listed in PEP 4.
2002-04-11 20:57:30 +00:00
Jack Jansen
85705e73b1 Got rid of obsolete defines. 2002-04-11 20:56:15 +00:00
Jack Jansen
786681ac60 Got rid of obsolete appearance flag. 2002-04-11 20:56:13 +00:00
Jack Jansen
cc8258d827 Added boolobject.c 2002-04-11 20:54:58 +00:00
Guido van Rossum
7df772b237 At CNRI's request, I'm changing the status of 1.6.1 from
not-GPL-compatible to GPL-compatible, with a footnote explaining that
RMS disagrees.  I'm not going to discuss this further -- both sides
(CNRI and RMS) will argue their POV till they're blue in the face.
2002-04-11 20:54:35 +00:00
Jack Jansen
5159f1da7d Got rid of ifdefs for long-obsolete GUSI versions and other lurkers. 2002-04-11 20:53:03 +00:00
Jack Jansen
32baa2c8d2 These are long obsolete. Get rid of them. 2002-04-11 20:50:39 +00:00
Jack Jansen
b19444feca Got rid of ifdefs for long-obsolete GUSI versions and other stuff that is now standard (appearance, interned strings) 2002-04-11 20:48:25 +00:00
Jack Jansen
8ab04b4d65 Got rid of ifdefs for long-obsolete GUSI versions. 2002-04-11 20:46:23 +00:00
Jack Jansen
9b745f6665 Get rid of USE_CACHE_ALIGNED. It has no function anymore. 2002-04-11 20:41:18 +00:00
Tim Peters
a7c2b303d4 Since xmllib is deprecated now, suppress the DeprecationWarning its test
module necessarily raises.
2002-04-11 20:18:40 +00:00