ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.89k stars 2.44k forks source link

Add Pyright type checking #2059

Closed marco-carvalho closed 1 month ago

marco-carvalho commented 2 months ago

Overview

This PR introduces Pyright, a static type checker for Python, into the yfinance project. The purpose is to ensure type safety and improve code quality by identifying type-related issues during development.

Benefits

Changes

ValueRaider commented 2 months ago

If this runs via Github actions, why does it need to be in requirements.txt?

marco-carvalho commented 2 months ago

@ValueRaider fixed!

ValueRaider commented 1 month ago

Does this require type hints in code to be useful?

marco-carvalho commented 1 month ago

Yes, Pyright will be most useful with type hints included in the code. While it can still check basic type correctness in code without type hints, its full potential is realized when explicit type annotations are used. This enhances its ability to catch type-related issues early during development, improving overall code quality and maintainability.