[issue23671] string.Template doesn't work with the self keyword argument

Serhiy Storchaka report at bugs.python.org
Fri Mar 27 17:13:15 CET 2015


Serhiy Storchaka added the comment:

It matches error messages generated by builtin unbound methods.

>>> str.format()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: descriptor 'format' of 'str' object needs an argument

It would be incorrect to say "substitute method wants x y z", because the substitute method doesn't need any arguments.

>>> string.Template('spam').substitute()
'spam'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23671>
_______________________________________


More information about the Python-bugs-list mailing list