Type checking

Manfred Lotz ml_news at posteo.de
Sun Oct 20 01:05:21 EDT 2019


On Sat, 19 Oct 2019 21:58:23 -0700
Paul Rubin <no.email at nospam.invalid> wrote:

> Manfred Lotz <ml_news at posteo.de> writes:
> > def main():
> >     print(greeting(1))
> >
> > Any idea why mypy doesn't detect anything?  
> 
> 
> "main" doesn't have a type signature so it doesn't get checked.  The
> mypy docs explain this.  Try:
> 
>   def main() -> None:
>       print(greeting(1))

Aah, such easy. As pytype did it I didn't assume something like this.

Thanks a lot.

-- 
Manfred




More information about the Python-list mailing list