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
Some recent changes (eg, #189) have created difficulties for Pylance/Pyright to infer that Font.kerning is of type Kerning:
See also a non-property for comparison:
Is it because that the property class isn’t generic? I tried to look into issue tickets in the Pylance and Pyright projects but haven’t found anything helpful.
Potential solution
Seems it works alright if we write the properties (eg, .kerning and .lib) in the decorator style:
To be clear, I don’t really understand type checkers enough to tell if the decorator method is an arbitrary workaround or a long term solution, and I certainly don’t want to make the maintainers to randomly patch ufoLib2 only for some specific type checkers’ temporary limitations…
The text was updated successfully, but these errors were encountered:
Problem
Some recent changes (eg, #189) have created difficulties for Pylance/Pyright to infer that Font.kerning is of type Kerning:
See also a non-property for comparison:
Is it because that the property class isn’t generic? I tried to look into issue tickets in the Pylance and Pyright projects but haven’t found anything helpful.
Potential solution
Seems it works alright if we write the properties (eg, .kerning and .lib) in the decorator style:
To be clear, I don’t really understand type checkers enough to tell if the decorator method is an arbitrary workaround or a long term solution, and I certainly don’t want to make the maintainers to randomly patch ufoLib2 only for some specific type checkers’ temporary limitations…
The text was updated successfully, but these errors were encountered: