Closed shiyang07ca closed 1 year ago
Fix local Python test utils overwriting built-in Python methods due to global module imports.
When using the --lang python -L parameter for local testing, if the following code is be tested in Python:
--lang python -L
from leetgo_py import * nums = [1, 2, 3,] list(nums)
It will prompt an runtime error message: nums = list(nums) TypeError: 'module' object is not callable.
nums = list(nums) TypeError: 'module' object is not callable
The code is mainly used to precisely control the imported content of a module leetgo_py that is imported entirely."
leetgo_py
I just released leetgo-py 0.2.2 for the fix, you can use .venv/bin/python -m pip install -U leetgo-py to upgrade.
leetgo-py
.venv/bin/python -m pip install -U leetgo-py
Fix local Python test utils overwriting built-in Python methods due to global module imports.
When using the
--lang python -L
parameter for local testing, if the following code is be tested in Python:It will prompt an runtime error message:
nums = list(nums) TypeError: 'module' object is not callable
.The code is mainly used to precisely control the imported content of a module
leetgo_py
that is imported entirely."