[+] improve check_type
This commit is contained in:
parent
ba3fe1284c
commit
3a01fc9e87
@ -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,7 +172,16 @@ def check_list(
|
||||
)
|
||||
|
||||
|
||||
def check_type(value: Any, VT: Type[Value]) -> Value:
|
||||
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
|
||||
|
BIN
releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl
(Stored with Git LFS)
Normal file
BIN
releases/whl/online_fxreader_pr34-0.1.5.19-py3-none-any.whl
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user