Subject: GSoC 2026 Proposal Idea: Systematic Type Hinting for SymPy (Custom Project)

86 views
Skip to first unread message

Harsh Gupta

unread,
Feb 25, 2026, 2:42:03 AM (3 days ago) Feb 25
to sympy

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

Oscar Benjamin

unread,
Feb 25, 2026, 5:48:40 AM (3 days ago) Feb 25
to sy...@googlegroups.com
On Wed, 25 Feb 2026 at 07:42, Harsh Gupta <harsh21...@gmail.com> wrote:
>
> 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.

Yes, I think that would be a reasonable project proposal. Most likely
sympy needs to use some sphinx extension or something for the docs.
Yes, actually annotating sympy's basic public functionality is highly
nontrivial. Also sympy should have a sympy.typing module that exposes
common types for downstream type annotations similar to numpy.typing.

--
Oscar
Message has been deleted

Harsh Gupta

unread,
Feb 25, 2026, 11:13:15 AM (3 days ago) Feb 25
to sympy

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:

  1. 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?

  2. 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.

  3. 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

Oscar Benjamin

unread,
Feb 25, 2026, 8:42:35 PM (2 days ago) Feb 25
to sy...@googlegroups.com
On Wed, 25 Feb 2026 at 16:10, Harsh Gupta <harsh21...@gmail.com> wrote:
>
> Well 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 ? 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 these details, I'll put together a rough timeline and share a drafft proposal here for feedback.

I would usually just ignore your email in this situation but I think I
need to make this clear to everyone including yourself and anyone else
on the mailing list.

You have responded to my email with something AI generated. The first
thing that you need to understand is how much that upsets me just in
itself. I really don't like it and it means that I don't want to talk
to you about anything so I'm not going to answer any of your
questions.

You might have had some reasons for doing this like maybe English is
not your first language or you wanted to have good grammar or
something but I need it to be made clear:
I absolutely hate LLM output. It enrages me regardless of whether you
think it is useful. I would prefer that you did anything else rather
than use an LLM for this.

I can accept bad grammar or typos or broken English or anything like
that. I have dealt with those things for many years and they are
totally fine. I make those errors myself when communicating with other
people. I cannot accept a person sending me LLM text as if it is from
themselves and this is not something that I will ever forgive.

In my mind there are two groups of people that I picture on the left
and on the right (in my brain visually, not politically). The
lhs-group are people who give me real human communication. Those
people would never send me an email that was written (in any part) by
ChatGPT.

In the rhs-group there are people who might use ChatGPT sometimes and
might insert some of that text into an email that would be sent to me.
I don't trust these people: any sentence in their emails can be a
hallucination. Every now and again a person from the lhs-group shows
me an em-dash and then they move to the rhs-group. That is an
irreversible process and they can never move back (I trust your words
mostly or not at all and you get the benefit of the doubt precisely
once).

--
Oscar

Harsh Gupta

unread,
Feb 25, 2026, 11:54:06 PM (2 days ago) Feb 25
to sympy
oscar,
I am really sorry. you are right i used an AI tool to rewrite my email before sending.

I was nervous about my English and communicating with the maintainers, and want to be as professional and proficient in english. But i see it was a huge mistake that broke the trust of the community. i should used my own words even if the grammae was not perfect. 

I heartly apologize to you and the rest of SymPy community for doing this and waste you time. 
thank you for reviewing and merging my PRs over last few months. i learned a lot from you all and again i am sorry i ruined that.

Harsh
Reply all
Reply to author
Forward
0 new messages