[+] improve check_type

This commit is contained in:
Siarhei Siniak 2025-08-01 12:43:55 +03:00
parent ba3fe1284c
commit 3a01fc9e87
3 changed files with 16 additions and 4 deletions

@ -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',

@ -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(

BIN
releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl (Stored with Git LFS) Normal file

Binary file not shown.