litestar-org / polyfactory

Simple and powerful factories for mock data generation
https://polyfactory.litestar.dev/
MIT License
986 stars 77 forks source link

Bug: pyright incompatability #518

Closed adhtruong closed 3 weeks ago

adhtruong commented 5 months ago

Description

Pyright emits typing errors for accessing generic instance variables through classes.

Potentially related pyright issues:

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Update pre-commit to v1.1.356 
2. Run pre-commit commits
3. See that `error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues)` is emitted for usages of generic class vars.

Screenshots

"In the format of: ![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Release Version

main

Platform


[!NOTE]
While we are open for sponsoring on GitHub Sponsors and OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.

Fund with Polar

guacs commented 4 months ago

Is there something we can do to fix this? I think the only option is to just # pyright: ignore[...] the affected (effected? idk english is annoying at times) lines right?