Skip to content

Make __init_subclass__ work with nontrivial RHSes#89

Merged
msullivan merged 1 commit intomainfrom
update-class
Feb 10, 2026
Merged

Make __init_subclass__ work with nontrivial RHSes#89
msullivan merged 1 commit intomainfrom
update-class

Conversation

@msullivan
Copy link
Collaborator

Basically the idea is to evaluate it with the type variable
substituted in. I had to rework the caching for boxes to prevent
infinite recursion.

It's still a TODO to properly report out GenericCallables for methods
with nontrivial computation at the top level, but the basic idea is to
try to get the annotation and raise a StuckException if we would
need to use an operator on a variable while evaluating a Bool or
Iter. Then if the exception got raised, we will produce a
GenericCallable.

@msullivan msullivan requested review from 1st1 and dnwpark February 7, 2026 01:58
@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
python-typemap Ready Ready Preview, Comment Feb 10, 2026 2:49am

Copy link
Contributor

@dnwpark dnwpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice cleanups

Basically the idea is to evaluate it with the type variable
substituted in.  I had to rework the caching for boxes to prevent
infinite recursion.

It's still a TODO to properly report out GenericCallables for methods
with nontrivial computation at the top level, but the basic idea is to
*try* to get the annotation and raise a StuckException if we would
need to use an operator on a variable while evaluating a Bool or
Iter. Then if the exception got raised, we will produce a
GenericCallable.
@msullivan msullivan merged commit 647848b into main Feb 10, 2026
3 of 4 checks passed
@msullivan msullivan deleted the update-class branch February 10, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants