Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e4fe5053e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FileClass: type[FileT], | ||
| FieldClass: type[FieldT], |
There was a problem hiding this comment.
Keep custom class overload parameters independently optional
The new generic FormParser.__init__ overload makes both FileClass and FieldClass required together, while the non-generic overload only accepts concrete type[File]/type[Field]. This introduces a typing regression for valid existing usage where only one custom class is provided (for example FileClass=MyFile with the default field class): runtime still supports it via defaults, but static checkers now reject it because no overload matches. Making these parameters independently optional in the generic overload (or adding mixed overloads) would preserve previous behavior.
Useful? React with 👍 / 👎.
| # Save classes. | ||
| self.FileClass = File | ||
| self.FieldClass = Field |
There was a problem hiding this comment.
The whole thing was non-used for 13 years. 👀
Summary
Removes the
FileClassandFieldClassparameters fromFormParser. The parser now consistently constructs the built-inFileandFieldclasses, and callback annotations are concrete accordingly.Also updates the coverage configuration to use
exclude_alsowith the reduced exclusion list.Validation
.venv/bin/mypy python_multipart multipart tests.venv/bin/pytest tests/test_multipart.py -q.venv/bin/ruff check python_multipart/multipart.py tests/test_multipart.py.venv/bin/ruff format --check --diff python_multipart/multipart.py tests/test_multipart.py