[Python-ideas] Add an option that allow check Type Hints in runtime

Pavol Lisy pavol.lisy at gmail.com
Sat Jul 9 16:23:03 EDT 2016


On 7/8/16, Chris Angelico <rosuav at gmail.com> wrote:
> On Fri, Jul 8, 2016 at 7:17 PM, Ma Lin <animalize81 at hotmail.com> wrote:

>> I mean add an runtime option, not a build option, it can be only enabled
>> in development/debugging:
>>      python -tc a.py
>> Without the option, the interpreter just ignores Type Hints:
>>      python a.py
>
> Right, but this means that the code to call a function has to check
> "was the --tc option specified?" before actually calling the function.

Could not interpreter just internally use "decorator trick" too?


More information about the Python-ideas mailing list