Commit Graph

84 Commits

Author SHA1 Message Date
Raymond Hettinger 5469324cde Note that \var{ppos} values are not consecutive and should not be altered. 2003-12-13 19:48:41 +00:00
Raymond Hettinger bc0f2ab9bb Expose dict_contains() and PyDict_Contains() with is about 10% faster
than PySequence_Contains() and more clearly applicable to dicts.

Apply the new function in setobject.c where __contains__ checking is
ubiquitous.
2003-11-25 21:12:14 +00:00
Fred Drake 28eae084bf fix use of undefined markup 2003-11-10 14:48:48 +00:00
Brett Cannon 35d8360bf7 Document Py_RETURN_NONE. 2003-11-09 04:15:30 +00:00
Raymond Hettinger 9c7ed4c6df Document that varlist can be NULL. 2003-10-26 17:20:07 +00:00
Martin v. Löwis 01a74b2fa1 Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
Martin v. Löwis 95cf84a4f3 Patch #821093: Fix various typos. 2003-10-19 07:32:24 +00:00
Raymond Hettinger cb2da43db8 Extended tuple's C API to include a new function, PyTuple_Pack() that is
useful for rapidly building argument tuples without having to invoke the
more sophisticated machinery of Py_BuildValue().
2003-10-12 18:24:34 +00:00
Raymond Hettinger f4bb1f946e Fix typo. 2003-08-23 03:38:11 +00:00
Martin v. Löwis 5467d4c0e3 Patch #612627: Add encoding attribute to file objects, and determine
the terminal encoding on Windows and Unix.
2003-05-10 07:10:12 +00:00
Fred Drake c22b2999f6 fix some markup errors 2003-04-23 20:38:41 +00:00
Thomas Heller 34d7f0927b Document the new functions PyInt_AsUnsignedLongMask(), PyInt_AsUnsignedLongLongMask(),
PyLong_AsUnsignedLongMask(), PyLong_AsUnsignedLongLongMask().
2003-04-23 19:51:05 +00:00
Martin v. Löwis 24b8881f61 Patch #701395: Correct documentation of PyUnicode_Splitlines. 2003-03-30 16:40:42 +00:00
Ka-Ping Yee bd379e9627 PyWeakref_GetObject returns None (not NULL) when the referent is gone. 2003-03-28 18:07:16 +00:00
Skip Montanaro 1ff49a7734 * Add description of PyInt_FromString.
* Correct description of PyFloat_FromString.  While ignored, the pend
  argument still has to be given.
* Typo in PyLong_FromString.
2003-02-03 05:13:24 +00:00
Skip Montanaro ae31e9b8c7 Add PyFloat_FromString. Left the char **pend argument out of the
description since while there, it is useless and ignored, according to Tim's
commen.  (PyInt_FromString is also not described, but PyLong_FromString is.
Is the former deprecated?)
2003-02-03 03:56:36 +00:00
Fred Drake 4b2472647a Clarified the error cases and Unicode handling of PyString_AsString(),
PyString_AsStringAndSize(), and PyString_AS_STRING().
Closes SF bug #606463.
2002-10-22 20:20:20 +00:00
Fred Drake 1d1e1dba12 Corrected return type and value information for PyUnicode_Count() and
PyUnicode_Find().
This closes SF bug #566631.
2002-06-20 22:07:04 +00:00
Michael W. Hudson 5efaf7eac8 This is my nearly two year old patch
[ 400998 ] experimental support for extended slicing on lists

somewhat spruced up and better tested than it was when I wrote it.

Includes docs & tests.  The whatsnew section needs expanding, and arrays
should support extended slices -- later.
2002-06-11 10:55:12 +00:00
Thomas Heller 541703b18f Typo: whcar_t should be wchar_t.
Bugfix candidate? Don't know how this is handled in the docs.
2002-04-29 17:28:43 +00:00
Fred Drake 432425e834 Small markup adjustments for consistency. 2002-04-29 15:17:16 +00:00
Tim Peters 5de9842b34 Repair widespread misuse of _PyString_Resize. Since it's clear people
don't understand how this function works, also beefed up the docs.  The
most common usage error is of this form (often spread out across gotos):

	if (_PyString_Resize(&s, n) < 0) {
		Py_DECREF(s);
		s = NULL;
		goto outtahere;
	}

The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s):  s is already
NULL!  A correct way to write the above is the simpler (and intended)

	if (_PyString_Resize(&s, n) < 0)
		goto outtahere;

Bugfix candidate.
2002-04-27 18:44:32 +00:00
Fred Drake f495ef7466 Warn people away from PyModule_GetDict(), but not too strongly.
(The real issue is whether modules can benefit from an alternate
implementation strategy rather than using a dictionary.  We should migrate
away from direct dictionary manipulation to allow more room for Jeremy to
flex the implementation with changes in globals lookup.)
2002-04-12 19:32:07 +00:00
Fred Drake 28de8d4b37 Add a (very) simple description of PyType_Ready(). 2002-04-12 16:15:10 +00:00
Fred Drake e3c764b6c2 Document PyType_CheckExact(), PyType_IS_GC().
Update description of PyType_Check().
2002-04-10 17:52:52 +00:00
Fred Drake 6ccdccd35d Add a note that Py_None needs the same reference count treatment as any
other PyObject *.
This closes SF bug #494007.
2002-03-12 20:12:54 +00:00
Skip Montanaro ea3ceaa913 PyDict_Next: update doc to indicate that pkey and pvalue return values are
borrowed references.
2002-01-23 10:54:41 +00:00
Skip Montanaro a23bc42ad5 add missing return value info for PyDict_DelItem 2002-01-23 08:18:30 +00:00
Fred Drake 54e6294197 A number of small adjustments. 2001-12-11 19:40:16 +00:00
Tim Peters f582b82fe9 SF bug #491415 PyDict_UpdateFromSeq2() unused
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.
2001-12-11 18:51:08 +00:00
Fred Drake 32a3587345 Document that PyString_FromString() cannot take NULL as a parameter.
This closes SF bug #489872.
2001-12-06 20:38:15 +00:00
Fred Drake 454af89712 Update the signature of PyFile_WriteString(). 2001-11-29 22:42:59 +00:00
Fred Drake cd8474e6a2 Add documentation for the PyCell* APIs. 2001-11-26 21:29:17 +00:00
Fred Drake 3adf79e3e2 Break the Python/C API manual into smaller files by chapter. This manual
has grown beyond what font-lock will work with using the default (X)Emacs
settings.

Indentation of the description has been made consistent, and a number of
smaller markup adjustments have been made as well.
2001-10-12 19:01:43 +00:00