rnag / rnag/dataclass-wizard

mypy invalid syntax in python version 3.11 and earlier

Open
#199 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

acknowledged awaiting-user-input
Dominant language
Python
Stars
250
Forks
36
PR merge metrics
No merged PRs in 30d

Description

The file https://github.com/rnag/dataclass-wizard/blob/main/dataclass_wizard/utils/object_path.pyi uses the new syntax defined in PEP695 which adds the generic type alias. This new alias was added for python 3.12 and as such causes syntax errors in mypy when checking using python version 3.11 or earlier

Repro:
Python version: 3.11.13
mypy version: 1.17.1
dataclass-wizard version: 0.35.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with dataclass_wizard/utils/object_path.pyi and reproduce the reported mypy check using Python 3.11.13 and mypy 1.17.1. Review the PEP 695 syntax in that file and verify that the compatibility issue is resolved for Python 3.11 and earlier without breaking the type stub.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.