Message209229
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) |
|
Date |
User |
Action |
Args |
2014-01-25 19:19:35 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, pitrou, taleinat, ezio.melotti, mrabarnett |
2014-01-25 19:19:35 | serhiy.storchaka | set | messageid: <1390677575.43.0.25754418539.issue20283@psf.upfronthosting.co.za> |
2014-01-25 19:19:35 | serhiy.storchaka | link | issue20283 messages |
2014-01-25 19:19:35 | serhiy.storchaka | create | |
|