j178 / leetgo

Best LeetCode friend for geek. :snowboarder:
MIT License
527 stars 33 forks source link

[Bug] python `serialize` may have redundant type value in `solution.py` #275

Closed rgbygv closed 6 months ago

rgbygv commented 6 months ago

leetgo debug

None

Debug log

No response

Description

serialize(ans, "boolean") will fail in solution.py, "boolean" may be redundant I've been having this problem since yesterday.

TypeError: serialize() takes 1 positional argument but 2 were given 
if __name__ == "__main__":
    jug1Capacity: int = deserialize("int", read_line())
    jug2Capacity: int = deserialize("int", read_line())
    targetCapacity: int = deserialize("int", read_line())
    ans = Solution().canMeasureWater(jug1Capacity, jug2Capacity, targetCapacity)
    print("\noutput:", serialize(ans, "boolean"))
j178 commented 6 months ago

Sorry for the issue.

This is because the leetgo-py package is not updated. Currently you need to upgrade it manually:

path/to/python-source-folder/.venv/bin/python -m pip install -U leetgo-py

I will figure out a better auto-upgrade strategy in later version.