positive_tool 是一個面向開發者的工具庫。
支援 cpython 3.113.15 及 pypy 3.113.12
從 pypi 下載
使用 uv
uv add positive-tool
使用 pip
pip install positive-tool
執行
uv sync --extra test
uv run pytest>>> from positive_tool import verify
>>> from positive_tool.exceptions import exceptions
>>>
def test_func(arg: int):
verify.ArgType("arg", arg, [int])
print(arg)
>>>
try:
test_func("the arg's type is int not str, so this arg is wrong type")
except exceptions.verify.ArgTypeWrongTypeError:
pass
>>>test_func(10)
10版權所有 (C) 2026 TW0hank0
本程式為自由軟體:您可以根據自由軟體基金會發佈的 GNU Affero 通用公共授權條款
第 3 版(僅此版本)重新發佈及/或修改本程式。
本程式的發佈是希望它能發揮功用,但不提供任何擔保;
甚至沒有隱含的適銷性或特定目的適用性擔保。詳見 GNU Affero 通用公共授權條款。
您應該已經收到一份 GNU Affero 通用公共授權條款副本。
如果沒有,請參見 <https://www.gnu.org/licenses/>。
協議全文請見 LICENSE.txt 檔案。