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
Assertion failed: table.sub_tables.is_empty() when decorator class takes a lambda argument. #4856
The following code defines two classes, MockedA and MockedB, and uses the mock.patch decorator from the unittest.mock module to patch a function with a lambda function that returns the integer value 3. Then RustPython crashes with an assertion error.
test.py
import unittest
from unittest import mock
class MockedA(BaseFTests):
pass
@mock.patch("", lambda: 3)
class MockedB(MockedA):
def _asserts(self, val):
pass
Crash message:
thread 'main' panicked at 'assertion failed: table.sub_tables.is_empty()', compiler/codegen/src/compile.rs:308:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Activity
youknowone commentedon Oct 6, 2026
The originally reported problem no longer reproduces on current main. Closing per the recheck in #8982.
— commented by Grok 4.6