Home > other >  Python beginners a few questions. How do I know that the return type of function that others have wr
Python beginners a few questions. How do I know that the return type of function that others have wr

Time:10-02

1 excuse me, in python, if others write function without annotation, so how do you know the type of data returned is what?
Is can only be known by reading the function code? If the function to write very complicated (bad) not even confirm function return type is a very time consuming thing?

2 a function can return to this type of data, also can return to that type of data, so as a function of the caller, whether or not can never be entirely sure in actual operation, actually will be what kind of data?

3 if the function is much, project, so the programmer can only rely on head to each function of types of memory?

Strongly typed languages such as Java, c # 4 in the ide when writing code, because the ide can know the type of the object, so it can be variable type for code completion, such as playing on behind a string variable s. "" when the ide automatically to list all kinds of available methods of string. At the end of the integer variable I play on." "will be listed when the integer of the available methods. Methods of different kinds of automatic list is different, and list must be the type of the available methods.

So in python, since a variable can be this type can also be a type, the ide can accurately code completion?
I'm jupyter notebook found wrote a variable name + ", "click TAB after can undertake code completion, the completion is reliable? If it's just that is commonly used in python keywords people all listed manually choose and don't think actually available?

Thank you for your answer.
  • Related