Hi everyone,
I'm Harsh, a 3rd-year BCA student. I've been contributing to SymPy over the last few months to get a solid feel for the codebase before GSoC.
Recently, while adding type hints to graycode.py (#29126) and magic.py (#28928), I went down a bit of a rabbit hole. I quickly realized how tricky it is to properly type-hint SymPy's Basic objects, deal with TypeVar vs Sequence, and actually get the Sphinx docs to build without throwing reference errors.
Because of this experience, I wanted to ask: Would the mentors be open to a custom GSoC project (175 or 350 hours) focused on "Systematic Type Hinting & Code Quality"? I know it’s not explicitly on the 2026 Ideas list, but the goal would be to systematically add strict type hints to major core modules, resolve the underlying mypy errors, and ensure the Sphinx docs render the types correctly.
If you feel this is too maintenance-focused or out-of-scope for GSoC, no worries at all! If that's the case, I am also really interested in the Code Generation or Group Theory projects, and I'd love to know which of those has a higher priority for the maintainers this year.
For context, here are my recently merged PRs (touching combinatorics, core, utilities, and printers):
#29126: Type hints in combinatorics/graycode.py
#28993: NumPyPrinter support for Contains(x, S.Integers)
#28956: Fixed Pow.as_real_imag assuming real result for zero base
#28928: Type hints in utilities/magic.py
Thanks for your time, and thanks to the reviewers who have helped me so far!
---- Harsh Gupta
Thanks for the feedback! I really like the idea of a sympy.typing module—it makes a lot of sense and would be hugely helpful for anyone using SymPy downstream.
Before I start drafting a full proposal, I want to do a bit of research to make sure I'm scoping this correctly. I just have a few quick questions:
Scope of sympy.typing: What kind of types/aliases are you picturing here initially? Are we talking broad types like ExprLike and BasicType, or more specific ones?
Sphinx Extensions: Has the team already tried any specific Sphinx extensions for type hints (like sphinx-autodoc-typehints)? I want to check if there are any known bugs or blockers from past attempts before I start testing them.
Priorities: Which modules would you consider the absolute highest priority when annotating the "basic public functionality"? Should I plan to focus mostly on core, matrices, etc.?
Once I have a better feel for these details, I'll put together a rough timeline and share a draft proposal here for feedback.
Thanks again for the guidance!
--- Harsh