<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Include/methodobject.h, branch zooba-patch-1</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>Implemented Martin's suggestion to clear the free lists during the garbage collection of the highest generation.</title>
<updated>2008-02-14T12:47:33+00:00</updated>
<author>
<name>Christian Heimes</name>
<email>christian@cheimes.de</email>
</author>
<published>2008-02-14T12:47:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=3b718a79af900fdacaf0b825137f69eadc753765'/>
<id>3b718a79af900fdacaf0b825137f69eadc753765</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.</title>
<updated>2007-12-19T02:37:44+00:00</updated>
<author>
<name>Christian Heimes</name>
<email>christian@cheimes.de</email>
</author>
<published>2007-12-19T02:37:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=e93237dfcc4ee4feee62adafb4e7899487ca864b'/>
<id>e93237dfcc4ee4feee62adafb4e7899487ca864b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>PEP 3123: Provide forward compatibility with Python 3.0, while keeping</title>
<updated>2007-07-21T06:55:02+00:00</updated>
<author>
<name>Martin v. Löwis</name>
<email>martin@v.loewis.de</email>
</author>
<published>2007-07-21T06:55:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=6819210b9e4e5719a6f7f9c1725f8fa70a8936f6'/>
<id>6819210b9e4e5719a6f7f9c1725f8fa70a8936f6</id>
<content type='text'>
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add const to several API functions that take char *.</title>
<updated>2005-12-10T18:50:16+00:00</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2005-12-10T18:50:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=af68c874a6803b4e90b616077a602c0593719a1d'/>
<id>af68c874a6803b4e90b616077a602c0593719a1d</id>
<content type='text'>
In C++, it's an error to pass a string literal to a char* function
without a const_cast().  Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc.  Predictably, there were a large set of functions that
needed to be fixed as a result of these changes.  The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes:  A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In C++, it's an error to pass a string literal to a char* function
without a const_cast().  Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc.  Predictably, there were a large set of functions that
needed to be fixed as a result of these changes.  The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes:  A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
</pre>
</div>
</content>
</entry>
<entry>
<title>Wrote down the invariants of some common objects whose structure is</title>
<updated>2004-10-28T16:32:00+00:00</updated>
<author>
<name>Armin Rigo</name>
<email>arigo@tunes.org</email>
</author>
<published>2004-10-28T16:32:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=89a39461bff04b80bb4857790350e1ab30ff2df9'/>
<id>89a39461bff04b80bb4857790350e1ab30ff2df9</id>
<content type='text'>
exposed in header files.  Fixed a few comments in these headers.

As we might have expected, writing down invariants systematically exposed a
(minor) bug.  In this case, function objects have a writeable func_code
attribute, which could be set to code objects with the wrong number of
free variables.  Calling the resulting function segfaulted the interpreter.
Added a corresponding test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
exposed in header files.  Fixed a few comments in these headers.

As we might have expected, writing down invariants systematically exposed a
(minor) bug.  In this case, function objects have a writeable func_code
attribute, which could be set to code objects with the wrong number of
free variables.  Calling the resulting function segfaulted the interpreter.
Added a corresponding test.
</pre>
</div>
</content>
</entry>
<entry>
<title>* Added a new method flag, METH_COEXIST.</title>
<updated>2003-12-13T11:26:12+00:00</updated>
<author>
<name>Raymond Hettinger</name>
<email>python@rcn.com</email>
</author>
<published>2003-12-13T11:26:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=8f5cdaa784f555149adf5e94fd2e989f99d6b1db'/>
<id>8f5cdaa784f555149adf5e94fd2e989f99d6b1db</id>
<content type='text'>
* Used the flag to optimize set.__contains__(), dict.__contains__(),
  dict.__getitem__(), and list.__getitem__().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Used the flag to optimize set.__contains__(), dict.__contains__(),
  dict.__getitem__(), and list.__getitem__().
</pre>
</div>
</content>
</entry>
<entry>
<title>Provide __module__ attributes for functions defined in C and Python.</title>
<updated>2003-01-31T18:33:18+00:00</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2003-01-31T18:33:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=4f0dcc9a9a4629607d4fff79912e8d0c86cd3914'/>
<id>4f0dcc9a9a4629607d4fff79912e8d0c86cd3914</id>
<content type='text'>
__module__ is the string name of the module the function was defined
in, just like __module__ of classes.  In some cases, particularly for
C functions, the __module__ may be None.

Change PyCFunction_New() from a function to a macro, but keep an
unused copy of the function around so that we don't change the binary
API.

Change pickle's save_global() to use whichmodule() if __module__ is
None, but add the __module__ logic to whichmodule() since it might be
used outside of pickle.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__module__ is the string name of the module the function was defined
in, just like __module__ of classes.  In some cases, particularly for
C functions, the __module__ may be None.

Change PyCFunction_New() from a function to a macro, but keep an
unused copy of the function around so that we don't change the binary
API.

Change pickle's save_global() to use whichmodule() if __module__ is
None, but add the __module__ logic to whichmodule() since it might be
used outside of pickle.
</pre>
</div>
</content>
</entry>
<entry>
<title>Excise DL_EXPORT from Include.</title>
<updated>2002-08-12T07:21:58+00:00</updated>
<author>
<name>Mark Hammond</name>
<email>mhammond@skippinet.com.au</email>
</author>
<published>2002-08-12T07:21:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=91a681debf9ffec155d0aff8a0bb5f965f592e16'/>
<id>91a681debf9ffec155d0aff8a0bb5f965f592e16</id>
<content type='text'>
Thanks to Skip Montanaro and Kalle Svensson for the patches.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to Skip Montanaro and Kalle Svensson for the patches.
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce two new flag bits that can be set in a PyMethodDef method</title>
<updated>2002-03-28T05:33:33+00:00</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2002-03-28T05:33:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=7bf9715a8b794cb743fdac97a9014102985a3dd3'/>
<id>7bf9715a8b794cb743fdac97a9014102985a3dd3</id>
<content type='text'>
descriptor, as used for the tp_methods slot of a type.  These new flag
bits are both optional, and mutually exclusive.  Most methods will not
use either.  These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.

If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.

If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.

These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
descriptor, as used for the tp_methods slot of a type.  These new flag
bits are both optional, and mutually exclusive.  Most methods will not
use either.  These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.

If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.

If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.

These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove much dead code from ceval.c</title>
<updated>2001-08-12T21:52:24+00:00</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-08-12T21:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=910d7d46dce571fa81428718e9be5307a56adeee'/>
<id>910d7d46dce571fa81428718e9be5307a56adeee</id>
<content type='text'>
The descr changes moved the dispatch for calling objects from
call_object() in ceval.c to PyObject_Call() in abstract.c.
call_object() and the many functions it used in ceval.c were no longer
used, but were not removed.

Rename meth_call() as PyCFunction_Call() so that it can be called by
the CALL_FUNCTION opcode in ceval.c.

Also, fix error message that referred to PyEval_EvalCodeEx() by its
old name eval_code2().  (I'll probably refer to it by its old name,
too.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The descr changes moved the dispatch for calling objects from
call_object() in ceval.c to PyObject_Call() in abstract.c.
call_object() and the many functions it used in ceval.c were no longer
used, but were not removed.

Rename meth_call() as PyCFunction_Call() so that it can be called by
the CALL_FUNCTION opcode in ceval.c.

Also, fix error message that referred to PyEval_EvalCodeEx() by its
old name eval_code2().  (I'll probably refer to it by its old name,
too.)
</pre>
</div>
</content>
</entry>
</feed>
