[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed, there were several solutions to this. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread STINNER Victor
STINNER Victor added the comment: self doesn't need to have a name, you can use: def bind(*args, **kw): self = args[0] args = args[1:] To accept any name ;-) -- nosy: +haypo ___ Python tracker ___

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed to 3.3 and default! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49fd1c8aeca5 by Antoine Pitrou in branch '3.3': Issue #17071: Signature.bind() now works when one of the keyword arguments is named ``self``. http://hg.python.org/cpython/rev/49fd1c8aeca5 New changeset 4ff1dc8c0a3c by Antoine Pitrou in branch 'defa

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks Antoine, the patch looks good to me. The only thing I would have done differently myself is to name "self" as "__bind_self__" (with two underscores at the end). Could you please apply the patch? -- ___ Pytho

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file28900/sig_bind_self.patch ___ Python tracker ___ ___

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: I'll take a look later today. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue17071] Signature.bind() fails with a keyword argument named "self"

2013-01-29 Thread Antoine Pitrou
New submission from Antoine Pitrou: >>> def f(a, self): pass ... >>> sig = inspect.signature(f) >>> sig.bind(1, 2) >>> sig.bind(a=1, self=2) Traceback (most recent call last): File "", line 1, in TypeError: bind() got multiple values for argument 'self' -- components: Library (Lib)