[Python-checkins] r54466 - in python/branches/release25-maint: Include/setobject.h Lib/test/test_set.py Objects/dictobject.c Objects/setobject.c

Thomas Wouters thomas at python.org
Wed Mar 21 17:35:52 CET 2007


On 3/21/07, Anthony Baxter <anthony at interlink.com.au> wrote:
>
> On Wednesday 21 March 2007 22:27, A.M. Kuchling wrote:
> > On Wed, Mar 21, 2007 at 03:06:44PM +1100, Anthony Baxter wrote:
> > > Why is new behaviour and a new C API being added to Python
> > > 2.5???
> >
> > -PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos,
> > PyObject **entry); +PyAPI_FUNC(int) _PySet_Next(PyObject *set,
> > Py_ssize_t *pos, PyObject **key); +PyAPI_FUNC(int)
> > _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key,
> > long *hash);
> >
> > Isn't the new function is Python-internal, not part of the
> > official API, because of the leading underscore?
>
> Unless I'm mistaken, it's also adding the ability to pass a set to
> the dict constructor.


No, I don't believe it does; it just specialcases dict.fromkeys(some_set)
for performance, not for added functionality. I still do not think this
should be done in Python 2.5, though: it's not a bugfix, and adding such
performance enhancements is prone to introducing bugs.

-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-checkins/attachments/20070321/c9d1ce08/attachment.htm 


More information about the Python-checkins mailing list