LPSim / backend

LPSim: Genius Invokation TCG simulator 七圣召唤水皇模拟器 :sparkles: 4.5已更新
https://pypi.org/project/lpsim/
GNU Affero General Public License v3.0
16 stars 3 forks source link

fix: false positive for union types #90

Closed xqm32 closed 7 months ago

zyr17 commented 7 months ago

https://github.com/LPSim/backend/blob/7d4c587c59a2983c591bb2507f643d377f3236f4/src/lpsim/server/status/team_status/anemo_characters.py#L67-L69

So previous error line still cannot be detected by pyright? What errors will be detected by pyright?

xqm32 commented 7 months ago

https://github.com/LPSim/backend/blob/7d4c587c59a2983c591bb2507f643d377f3236f4/src/lpsim/server/status/team_status/anemo_characters.py#L67-L69

So previous error line still cannot be detected by pyright? What errors will be detected by pyright?

The error line will be detected in strict mode^1. But it's now configured to follows the Pylance extension's basic type check mode and just does a very simple check. That's meaning if your VS Code does not complain about typing, so does the pyright.

We can also use Pypa's mypy to run type check, but it's much slower than pyright. Currently it seems that the Microsoft's official Pylance extension does not always follow the mypy rules, which may result in false positive when we are coding with Pylance extension.

xqm32 commented 7 months ago

That's meaning if your VS Code does not complain about typing, so does the pyright.

Correct: Only if the bundled pyright version for Pylance is same to the version we used in CI.