This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, mrabarnett, pitrou, serhiy.storchaka, taleinat, terry.reedy
Date 2014-01-25.19:19:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390677575.43.0.25754418539.issue20283@psf.upfronthosting.co.za>
In-reply-to
Content
Here is patch for 3.3 which adds alternative parameter name. Now both keyword names are allowed, but deprecation warning is emitted if old keyword name is used.

>>> import re
>>> p = re.compile('')
>>> p.match()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Required argument 'string' (pos 1) not found
>>> p.match('')
<_sre.SRE_Match object at 0xb705c598>
>>> p.match(string='')
<_sre.SRE_Match object at 0xb705c720>
>>> p.match(pattern='')
__main__:1: DeprecationWarning: The 'pattern' keyword parameter name is deprecated.  Use 'string' instead.
<_sre.SRE_Match object at 0xb705c758>
>>> p.match('', string='')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Argument given by name ('string') and position (1)
>>> p.match('', pattern='')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Argument given by name ('pattern') and position (1)
History
Date User Action Args
2014-01-25 19:19:35serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, pitrou, taleinat, ezio.melotti, mrabarnett
2014-01-25 19:19:35serhiy.storchakasetmessageid: <1390677575.43.0.25754418539.issue20283@psf.upfronthosting.co.za>
2014-01-25 19:19:35serhiy.storchakalinkissue20283 messages
2014-01-25 19:19:35serhiy.storchakacreate