From 3a01fc9e87fc5795ac75aca9238d1cbdc09a9a42 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 1 Aug 2025 12:43:55 +0300 Subject: [PATCH] [+] improve check_type --- python/meson.build | 2 +- .../fxreader/pr34/commands_typed/cli_bootstrap.py | 15 ++++++++++++--- ...online_fxreader_pr34-0.1.5.19-py3-none-any.whl | 3 +++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index ca7fdee..cff2a3b 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.18', + version: '0.1.5.19', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 40e9f45..ca9cc64 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -172,10 +172,19 @@ def check_list( ) -def check_type(value: Any, VT: Type[Value]) -> Value: - assert isinstance(value, VT) +def check_type( + value: Any, + VT: Type[Value], + attribute_name: Optional[str] = None, +) -> Value: + if attribute_name: + attribute_value = getattr(value, attribute_name) + assert isinstance(attribute_value, VT) + return attribute_value + else: + assert isinstance(value, VT) - return value + return value def pyproject_load( diff --git a/releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl new file mode 100644 index 0000000..07d5c9b --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c41fac5f3f04295d11aff5a55783580c39a2bbf783c24434af9eab82ecaf7830 +size 72256