Author serhiy.storchaka
Recipients georg.brandl, serhiy.storchaka
Date 2015-03-15.08:21:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426407694.34.0.298286807857.issue23671@psf.upfronthosting.co.za>
In-reply-to
Content
string.Template doesn't allow to specify the self substitute parameter as keyword argument.

>>> import string
>>> string.Template('the self is $self').substitute(self='bozo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: substitute() got multiple values for argument 'self'
>>> string.Template('the self is $self').safe_substitute(self='bozo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: safe_substitute() got multiple values for argument 'self'

The same issue is with string.Formatter.format:

>>> string.Formatter().format('the self is {self}', self='bozo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: format() got multiple values for argument 'self'

Proposed patch fixes these issues.
History
Date User Action Args
2015-03-15 08:21:34serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl
2015-03-15 08:21:34serhiy.storchakasetmessageid: <1426407694.34.0.298286807857.issue23671@psf.upfronthosting.co.za>
2015-03-15 08:21:34serhiy.storchakalinkissue23671 messages
2015-03-15 08:21:34serhiy.storchakacreate