You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[mypyc] Default of an i64 parameter is lost when compiled code calls the method on an interpreted subclass (fixed on master, still in 2.4.1) #22353
When a native class has @mypyc_attr(allow_interpreted_subclasses=True) and a method with a parameter of type i64 (from mypy_extensions) that has a default, a call from compiled code that omits the argument gets 0 instead of the default when self is an instance of an interpreted (Python) subclass. The same call on an instance of the native class gets the default. A call from interpreted code on the subclass also gets the default. The subclass does not override the method.
We met this when compiling sqlglot with mypyc and subclassing its parser in Python: Parser._advance(self, times: i64 = 1) moved by 0 positions, so no statement parsed. A parameter typed int keeps its default, so our build rewrites these parameters to int as a workaround.
This no longer reproduces on master (ccbf32b). A bisect between the 2.4.1 merge base and master points at #22121 as the fix. Could that change be included in a 2.4.x release?
Activity
rob2244 commentedon Nov 3, 2026
Closing: filed by mistake. This is already fixed on master by #22121.