[issue19140] inspect.Signature.bind() inaccuracies

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Pushed in 3.4.
Yann, thank you for the bug report and the patch!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19140] inspect.Signature.bind() inaccuracies

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9cb32426d580 by Yury Selivanov in branch 'default':
inspect.Signature.bind: Fix pos-only params with defaults; fix *args in named 
args #19140
http://hg.python.org/cpython/rev/9cb32426d580

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19140] inspect.Signature.bind() inaccuracies

2014-01-28 Thread Yury Selivanov

Changes by Yury Selivanov :


--
assignee:  -> yselivanov
nosy: +yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19140] inspect.Signature.bind() inaccuracies

2013-10-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19140] inspect.Signature.bind() inaccuracies

2013-10-01 Thread Yann Kaiser

New submission from Yann Kaiser:

A pair of inconsistencies I've found using Signature.bind:

(=0).bind() -*> TypeError
Letting the default value of a positional-only parameter be used raises a 
TypeError with message that 'a' was passed by name.

(a, *args).bind(a=0, args=1) -> BoundArguments({'a': 0, 'args': 1})
Should positional arguments not be enough for bind() to reach the parameter 
before *args, bind() will process the *args parameter while looking for named 
arguments, and eventually bind the *args parameter to any named argument for 
it, instead of leaving that named argument for **kwargs or erroring out.

I've attached a patch that tests and fixes both issues.

I've taken the liberty of extending 
test_inspect.TestSignatureBind.test_signature_bind_positional_only as it 
already did all the setup needed but overlooked to check the condition where a 
defaulted positional-only parameter is left out.

--
components: Library (Lib)
files: sig_bind_posodefa_varargs.patch
keywords: patch
messages: 198806
nosy: epsy
priority: normal
severity: normal
status: open
title: inspect.Signature.bind() inaccuracies
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31940/sig_bind_posodefa_varargs.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com