Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Closed
Description
% cat gsl.pyimport inspectdef test_list_add(self): def capybara() -> None: assert_is_value( [x] + [y], z, ) assert_is_value( # in the binop implementation a, )print(inspect.getsourcelines(test_list_add))% python3.11 gsl.py (['def test_list_add(self):\n', ' def capybara() -> None:\n', ' assert_is_value(\n', ' [x] + [y],\n', ' z,\n', ' )\n', ' assert_is_value(\n', ' # in the binop implementation\n', ' a,\n', ' )\n'], 3)% ~/py/cpython/python.exe gsl.py (['def test_list_add(self):\n', ' def capybara() -> None:\n', ' assert_is_value(\n', ' [x] + [y],\n', ' z,\n', ' )\n', ' assert_is_value(\n', ' # in the binop implementation\n'], 3)% ~/py/cpython/python.exe -VPython 3.12.0b1+
On 3.12, the last two lines (a, )
) are not returned as part of the source lines. When I tried to minify by removing the first assert_is_value() call, it instead returned the print() line as part of the function.
This looks related to the tokenizer, cc@pablogsal@lysnikolaou.