Closed
Description
Correct me if this issue has already been addressed, but I found the no error for an implicitly defined return value troubling. It seems as if this would not be static typing because the return value should explicitly defined (whatever it is) for statically typed languages.
I think there should be a difference between these two functions when run through the parser, in that the second one should raise an error for not having an explicitly defined return value:
def f() -> None:
print('Hello world')
def g():
print('Hello world')
In statically typed languages like Java, return values must be explicitly defined, whether they are void
, String
s, or primitive data types, for instance:
public void test1() {
System.out.println("Hello world");
}
Metadata
Metadata
Assignees
Labels
No labels