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

2015-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It matches error messages generated by builtin unbound methods. >>> str.format() Traceback (most recent call last): File "", line 1, in TypeError: descriptor 'format' of 'str' object needs an argument It would be incorrect to say "substitute method wants x

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

2015-03-27 Thread Éric Araujo
Éric Araujo added the comment: "descriptor 'substitute' of 'Template' object needs an argument" These error messages don’t seem very user-friendly. I think the style in the rest of the module is like "substitute method wants x y z". -- nosy: +eric.araujo _

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

2015-03-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is a nice catch of a subtle bug and a nice fix. I verified that replacing 'self' with '*args' does not simply shift the problem from 'self' to 'args'. >>> class C: def test(*args, **kwargs): print(args, kwargs ) >>> c = C(

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

2015-03-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

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

2015-03-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c19778123a3 by Serhiy Storchaka in branch '2.7': Issue #23671: string.Template now allows to specify the "self" parameter as https://hg.python.org/cpython/rev/1c19778123a3 New changeset 7a4b499c4dc0 by Serhiy Storchaka in branch '3.4': Issue #23671

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

2015-03-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2015-03-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch addresses Paul's and Demian's comments. Converting the format_string parameter to positional parameter can break third-party code, so this needs a deprecation period. -- Added file: http://bugs.python.org/file38590/string_formatting_sel

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

2015-03-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: 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 "", line 1, in TypeError: substitute()