new-ara-api icon indicating copy to clipboard operation
new-ara-api copied to clipboard

Use type hints strictly

Open injoonH opened this issue 1 year ago • 0 comments

Type Hinting

Check PEP 484 for type hinting rules.

Type Checkers

Pyright

  1. Settings

    .vscode/settings.json

    {
      "python.analysis.typeCheckingMode": "strict"
    }
    
  2. Command

    pyright . # 844 errors
    
  3. Problems

    • Django 관련 에러 해결이 안 된다.
    • django-stubs를 사용하려 했는데 django-stubs는 mypy를 사용한다.
      • (django-stubs를 설치해도 pyright에서는 해결되지 않는다.)

Mypy

  1. Settings

    mypy.ini: @DoyunShin이 PyTorch에서 reference를 얻었다. mypy-strict.ini도 있어서 option을 어떻게 사용할지 더 알아본다.

    Getting started를 따라 Mypy를 설치한다.

  2. Command

    Mypy . # 775 erros
    

injoonH avatar Oct 04 '23 19:10 injoonH