[New-bugs-announce] [issue20283] Wrong keyword parameter name in regex pattern methods
Serhiy Storchaka
report at bugs.python.org
Thu Jan 16 21:44:27 CET 2014
New submission from Serhiy Storchaka:
Documented (in docstring and in ReST documentation) signatures of the match, search and (since 3.4) fullmatch methods of regex pattern object are:
match(string[, pos[, endpos]])
search(string[, pos[, endpos]])
fullmatch(string[, pos[, endpos]])
However in implementation the first keyword argument by mistake named "pattern". This looks as nonsense. The pattern is object itself, and first argument is a string. First arguments in other methods (split, findall, etc) named "string", and module-level functions have both "pattern" and "string" parameters:
match(pattern, string, flags=0)
search(pattern, string, flags=0)
I think we should fix this mistake. The "pattern" name is obviously wrong and is not match the documentation.
----------
components: Library (Lib)
messages: 208311
nosy: ezio.melotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Wrong keyword parameter name in regex pattern methods
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20283>
_______________________________________
More information about the New-bugs-announce
mailing list