You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Python type hints (which can be validated using mypy or Pylance in vscode) are very helpful; fitz_new has much better coverage than fitz in this regard. However several methods are dynamically assigned (eg. Page.get_text is assigned from utils.get_text). These types are not visible to the typechecker.
Describe the solution you'd like
Use a type stub file to describe the type signatures of these functions so that typecheckers can see them, and include the typestub in PEP 484/561 - compliant fashion.
Thank you!
The text was updated successfully, but these errors were encountered:
Alternatively, instead of the dynamic assignment, use some kind of mixin class, or make the utils functions the dynamically assigned ones (since the docs all refer to the Page/Document class methods)
We are looking at possible architectural changes that will allow better type hints in future. But it's quite an involved process so there are no timescales at the moment.
Is your feature request related to a problem? Please describe.
Python type hints (which can be validated using mypy or Pylance in vscode) are very helpful; fitz_new has much better coverage than fitz in this regard. However several methods are dynamically assigned (eg. Page.get_text is assigned from utils.get_text). These types are not visible to the typechecker.
Describe the solution you'd like
Use a type stub file to describe the type signatures of these functions so that typecheckers can see them, and include the typestub in PEP 484/561 - compliant fashion.
Thank you!
The text was updated successfully, but these errors were encountered: