Elazar Gershuni
Elazar Gershuni
I think the issue is that we do not support function calls, so all the calls must be inlined.
@dthaler sure. For some reason I was under the impression we already have an issue for that.
(The label "bug" is not appropriate here but I can't remove it.)
@kirbyfan64 the proposal does not require unannotated functions to be type-safe. It simply allows annotated functions that use them to be slightly more type safe (peek into the immediate return...
To elaborate: ```python class A: pass def f(): return A(1) # no error here, even though A has no no-arg __init__ def g() -> None: f().bar() # error here ```
Either a literal or a direct constructor call on a globally defined class. (Part of the idea is that the return statements are also the documentation).
Yes, that could be a nice path. Atoms, then (recursively) tuples/lists, then simple names. My hope is this could be done as part of semantic analysis, just like the analysis...
I think it will be as safe as any other analysis performed by mypy. The first example is not a call to a global constructor; the second example defeats any...
I guess the discussion can be separated to two orthogonal questions: * What should be considered as "obvious" return type * How this mechanism is enabled: a flag for unannotated...
One problem with annotations is that they mean that the function will be checked. It also does not completely address the issue of clutter and laziness. I agree that if...