faster-cpython / ideas

1.67k stars 49 forks source link

Failure in test_general_eval in regmachine branch #529

Closed iritkatriel closed 1 year ago

iritkatriel commented 1 year ago

I have this test failure, not sure what to think about it:

======================================================================
ERROR: test_general_eval (test.test_builtin.BuiltinTest.test_general_eval)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/test/test_builtin.py", line 661, in test_general_eval
    self.assertEqual(eval('dir()', g, m), list('xyz'))
                     ^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
TypeError: 'M' object does not support item deletion

m is an instance of a mapping class which does not support deletions. The failure comes from here, when the name is "$0" and the value is NULL. On main there is no "$0" and all the 'real' locals are non-NULL (so no deletion is attempted on this object). Is it just that the test needs to change, or do we need to change something around the "$" variables?

markshannon commented 1 year ago

IMO, "$" variables should only exist in dis output. The locals should remain unchanged.

iritkatriel commented 1 year ago

Agreed.