[Python-Dev] cpython: Simplify the code of get_attrib_from_keywords somewhat. (original) (raw)

Eli Bendersky eliben at gmail.com
Mon Apr 22 20:03:01 CEST 2013


On Mon, Apr 22, 2013 at 10:13 AM, Serhiy Storchaka <storchaka at gmail.com>wrote:

On 22.04.13 15:52, eli.bendersky wrote:

http://hg.python.org/cpython/**rev/c9674421d78e<http://hg.python.org/cpython/rev/c9674421d78e> changeset: 83494:c9674421d78e user: Eli Bendersky <eliben at gmail.com> date: Mon Apr 22 05:52:16 2013 -0700 summary: Simplify the code of getattribfromkeywords somewhat.

- PyDictDelItem(kwds, attribstr); + PyDictDelItemString(kwds, ATTRIBKEY); PyDictGetItemString() and PyDictDelItemString() internally create a Python string. I.e. new code creates one additional string if attrib was found in kwds. - if (attrib) - PyDictUpdate(attrib, kwds); + assert(attrib); attrib can be NULL in case of memory allocation error.

Thanks, I'll review this

Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130422/20d05c1b/attachment.html>



More information about the Python-Dev mailing list