[issue32191] TypeError does not work when function with type hint

Kyeongpil report at bugs.python.org
Fri Dec 1 02:18:25 EST 2017


New submission from Kyeongpil <rudvlf0413 at korea.ac.kr>:

TypeError does not work when I input float variable into function that I give type hint.

example code is like this:
def a(b: int) -> int:
    return b+1

a(1.1)

and the result is 1.1.
However, I think it should throw TypeError Exception because type of input is float, not int.

----------
components: ctypes
messages: 307367
nosy: Kang
priority: normal
severity: normal
status: open
title: TypeError does not work when function with type hint
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32191>
_______________________________________


More information about the Python-bugs-list mailing list