New submission from STINNER Victor:

Attached patch makes _sre.compile() more strict on types: groupindex must be a 
dictionary and indexgroup must be a tuple.

Currently, indexgroup is passed as a list. I chose to convert it to a tuple to 
use less memory and to prevent unwanted changes. For unwanted changed, I'm not 
sure because groupindex remains a mutable dictionary. Do you think that it's 
worth it to require a tuple? Another option is to accept a list but to convert 
it to a list, but this change is more specific to the current implementation.

----------
files: sre_types.patch
keywords: patch
messages: 281373
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: _sre.compile(): be more strict on types of indexgroup and groupindex
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45590/sre_types.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28765>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to