Kotlin any type6/21/2023 ![]() If the function has no return statement at all, then it will also return None. If a function in Python ends with the word ‘return’ with value to return, then the function will return a value of ‘None’. ![]() There are several uses of ‘None’.įirstly, ‘None’ is the default return value for any function that does specify a return type, the equivalent of this in Kotlin is the return type of Unit. In fact, python needs only this one way of saying ‘Nothing to see here’. The Python None is a singleton object of type NoneType. What is the actual difference in meaning for all of these? ![]() Java has the keyword ‘ void‘ and the value ‘ null‘, kotlin has Unit, Nothing and null. Python has only one way of saying ‘there is nothing here’: None.
0 Comments
Leave a Reply. |