New submission from Narendra <cnrpr...@gmail.com>:

Hi Team,

I have observed a bug in re.groups() function behavior in Python as below:

Issue:
re.groups() is not validating the arguments

Example:
>>> m = re.match(r'(\w+)@(\w+)\.(\w+)','usern...@hackerrank.com')
>>> m.groups()
('username', 'hackerrank', 'com')
>>> m.groups(1)
('username', 'hackerrank', 'com')
>>> m.groups(100000000000)
('username', 'hackerrank', 'com')
>>>

>From the above, its clear that re.groups() and re.groups(<somevalue>) both are 
>same. I think re.groups() is not validating the arguments.

Please review the same and provide your comments whether my views are correct 
or wrong

----------
components: Regular Expressions
messages: 305751
nosy: ezio.melotti, mrabarnett, narendrac
priority: normal
severity: normal
status: open
title: re.groups() is not checking the arguments
type: behavior
versions: Python 2.7

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

Reply via email to