Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected type arguments for generic class "PRecord" (pylance/pyright) #242

Open
khusmann opened this issue Feb 4, 2022 · 2 comments
Open

Comments

@khusmann
Copy link

khusmann commented Feb 4, 2022

When trying the example with pylance/pyright in vscode, I get an "PylancereportMissingTypeArgument" type hint error:

e.g.:

class ARecord(PRecord):
    x = field()

PRecord is flagged with 'Expected type arguments for generic class "PRecord"'. Is this fixable somehow?

@slott56
Copy link

slott56 commented Feb 14, 2022

Getting this from mypy in strict mode.

error: Missing type parameters for generic type "PRecord"  [type-arg]

Example record

from pyrsistent import PRecord, field

class PointPR(PRecord):
    latitude = field(type=float)
    longitude = field(type=float)

@tobgu
Copy link
Owner

tobgu commented Feb 23, 2022

Thanks for reporting this. I'll have to take a deeper look at this as I haven't been to involved in the work around typing. I don't know what's wrong off the top of my head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants