[New-bugs-announce] [issue27438] Refactot simple iterators implementation

Serhiy Storchaka report at bugs.python.org
Sat Jul 2 02:40:08 EDT 2016


New submission from Serhiy Storchaka:

The implementation of iterators for str, bytes, bytearray, tuple and list is virtually the same. Proposed patch moves common code to the template file iterlib.h and parametrizes it with few macros.

The patch decreases the number of source lines by 600.

 Makefile.pre.in                    |    2 
 Objects/bytearrayobject.c          |  165 ------------
 Objects/bytesobject.c              |  167 -------------
 Objects/iterlib.h                  |  168 +++++++++++++
 Objects/listobject.c               |  468 ++++++++++--------------------------
 Objects/tupleobject.c              |  156 ------------
 Objects/unicodeobject.c            |  171 -------------
 PCbuild/pythoncore.vcxproj         |    1 
 PCbuild/pythoncore.vcxproj.filters |    3 
 9 files changed, 349 insertions(+), 942 deletions(-), 10 modifications(!)

----------
components: Interpreter Core
files: iterlib.patch
keywords: patch
messages: 269703
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Refactot simple iterators implementation
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43605/iterlib.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27438>
_______________________________________


More information about the New-bugs-announce mailing list