Answer the question
In order to leave comments, you need to log in
What the ... instead of a function body?
Hey!
Sometimes I look into the source code and find nothing for myself, because instead of the body of the function after the colon there are ...
def connect_ex(self, address: Union[_Address, bytes]) -> int: ...
def detach(self) -> int: ...
def dup(self) -> socket: ...
Answer the question
In order to leave comments, you need to log in
You could at least google what kind of file you are trying to look there:
.pyi files are stubs, their purpose and format is described in PEP 484. These files are not used by the interpreter at all, their purpose is to provide code typing information. For example, you have a third-party module without typing, which is not yours, you cannot edit it, but you would like to prescribe types:
# fizz.py def greet(who): return f'Hello {who}'
The solution is found with the help of a stub: you create a fizz.pyi file that contains a typed greet signature without implementation:
# fizz.pyi def greet(who: str) -> str: ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question