This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: TypeError does not work when function with type hint
Type: behavior Stage: resolved
Components: ctypes Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Kang
Priority: normal Keywords:

Created on 2017-12-01 07:18 by Kang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg307367 - (view) Author: Kyeongpil (Kang) Date: 2017-12-01 07:18
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.
msg307369 - (view) Author: Kyeongpil (Kang) Date: 2017-12-01 07:36
Oh, I confused the syntax of type hint.
Sorry
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76372
2017-12-01 12:13:25eric.smithsetresolution: fixed -> not a bug
2017-12-01 07:36:11Kangsetstatus: open -> closed
resolution: fixed
messages: + msg307369

stage: resolved
2017-12-01 07:18:25Kangcreate