python / typeshed

Collection of library stubs for Python, with static types
Other
4.38k stars 1.76k forks source link

stubs for fpdf2 have errors and are out-of-date #7792

Closed resnbl closed 2 years ago

resnbl commented 2 years ago

I am encountering a number of issues using pyright with the fpdf2 library, specifically with the fpdf.pyi file.

1) There are 4 type aliases to Literal strings: _xxx: TypeAlias = Literal["", ...] These incorrectly throw errors when a string variable (as opposed to string Literal) is used. Maybe they should just be str??

2) Thecell() and multicell() methods now accept arguments named new_x and new_y. I suspect this package has not been updated in a while to support new/changed functionality in fpdf2. The current version is 2.5.2 and the stubs indicate they are for 2.4.*.

I guess a more general question would be "How do I get 3rd party packages updated?"

JelleZijlstra commented 2 years ago

The general answer is "submit a PR" :). Contributions welcome!