Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-01-07.12:04:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Many re methods accepted the string parameter as a keyword argument by wrong name. This was fixed in issue20283. Wrong keyword names were still accepted, but a deprecation warning was emitted if use them. Proposed patch finishes the deprecation period (started since 3.4) and removes the support of wrong names.

Python 2.7.7, 3.3.6, 3.4-3.6:

>>> import re
>>> re.compile('.').match(pattern='a')
__main__:1: DeprecationWarning: The 'pattern' keyword parameter name is deprecated.  Use 'string' instead.
<_sre.SRE_Match object; span=(0, 1), match='a'>
>>> re.compile('.').match(string='a')
<_sre.SRE_Match object; span=(0, 1), match='a'>

Python 3.7:

>>> re.compile('.').match(pattern='a')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Required argument 'string' (pos 1) not found
Date User Action Args
2017-01-07 12:04:54serhiy.storchakasetrecipients: + serhiy.storchaka
2017-01-07 12:04:53serhiy.storchakasetmessageid: <>
2017-01-07 12:04:53serhiy.storchakalinkissue29195 messages
2017-01-07 12:04:53serhiy.storchakacreate