New submission from Jeremiah Lowin:

Tested in Python 3.3 and Python 3.4.0rc1 5e05d7d3db9c

If a function has keyword-only arguments but no keyword-only defaults, then 
calling inspect.getcallargs with no arguments results in the wrong TypeError 
being raised.

Example:

>>> import inspect
>>> def fn(*, a): 
>>>    pass
>>> inspect.getcallargs(fn)

Result: 
    TypeError: argument of type 'NoneType' is not iterable

Expected Result: 
    TypeError: fn() missing 1 required keyword-only argument: 'a'

----------
components: Library (Lib)
messages: 212509
nosy: jlowin
priority: normal
severity: normal
status: open
title: inspect.getcallargs() attempts to iterate over None
type: behavior
versions: Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to