How can mypy ignore a single line in a source file?

后端 未结 3 603
故里飘歌
故里飘歌 2021-02-04 23:28

I\'m using mypy in my python project for type checking. I\'m also using PyYAML for reading and writing the project configuration files. Unfortunately, when using the recommended

3条回答
  •  感情败类
    2021-02-04 23:55

    Also # mypy: ignore-errors at the top of the file you want to ignore all works, if you are using shebang and coding lines should be like this:

    #!/usr/bin/env python 
    #-*- coding: utf-8 -*-
    # mypy: ignore-errors
    

    Gvanrossum comment

提交回复
热议问题