What does def main () -> None do? [duplicate]

As is, it does absolutely nothing. It is a type annotation for the main function that simply states that this function returns None. Type annotations were introduced in Python 3.5 and are specified in PEP 484.

Annotations for the return value of a function use the symbol -> followed by a type. It is completely optional and if you removed it, nothing would change.

This will have absolutely no effect on execution, it is only taken under consideration if you use it with a type checking tool like mypy.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)