[New-bugs-announce] [issue25797] Default argument values with type hints break type correctness

Dhruv Rajvanshi report at bugs.python.org
Fri Dec 4 09:03:38 EST 2015


New submission from Dhruv Rajvanshi:

Specifying default arguments break the type system. The types of default values aren't matched with the type of the argument.
Moreover, having None as a default value changes the type declaration to Optional[T]. So, the declaration may be 
    f(a : int = None)
but this would be treated as
   f(a : Optional[int] = None)

----------
components: Library (Lib)
files: test.py
messages: 255864
nosy: Dhruv Rajvanshi
priority: normal
severity: normal
status: open
title: Default argument values with type hints break type correctness
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file41238/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25797>
_______________________________________


More information about the New-bugs-announce mailing list