3 ms·
The name: implies that the type of the "name" object is str. If you were consistent, then, def greeting(...):str would imply that the type of the greeting obje
by ghshephard 11y ago
The name: implies that the type of the "name" object is str. If you were consistent, then, def greeting(...):str would imply that the type of the greeting object is str, which is definitely not the case (it is "function"). The -> isn't defining the type, it's specifying what is returned.
- nikolay 11y agoBut it's not the name alone, it's the name with the signature. `greeting` might be `function`, but `greeting("nikolay")` type would be `str`.