Recently, as we’ve started using type hints for our internal APIs, we’ve noticed that the navigation on the right breaks when we’re using type hints on each function argument rather than having them as a single type comment.
Taking the example from
mypy’s Python 2 cheat sheet, we see that the
send_email function is not listed.
def send_email(address, # type: Union[str, List[str]] sender, # type: str cc, # type: Optional[List[str]] bcc, # type: Optional[List[str]] subject='', body=None # type: List[str] ): # type: (...) -> bool system.net.sendEmail("localhost:25", "firstname.lastname@example.org", "Subject", body, True, address)
Compared to the following, where the arguments don’t have the
I would expect to see all functions listed as in Fig. 2 when using type comments as in Fig. 1.