Closed khatchad closed 2 years ago
Hi,
In this example code, I believe that x
is reassigned to the string "Current working directory:"
. As such, there is a local variable x
which is a str
and we could not infer the parameter type from the given information so parameter 'x' would be any
. Hope that helps.
Ah, I see, the type inferencing is per line, i.e., there is a variable x
at some line and at this line it has some type. Thanks.
Consider the following modified
type_infer_example.py
(`:Running
type_infer_tutorial.py
on this file, I get the following output (slightly modified for clarify):Above, there are two entries for
x
but, actually, there is only onex
, i.e., the parameterx
. In other words, there is no variablex
.