[+] improve check_type
This commit is contained in:
parent
ba3fe1284c
commit
3a01fc9e87
@ -5,7 +5,7 @@ project(
|
|||||||
).stdout().strip('\n'),
|
).stdout().strip('\n'),
|
||||||
# 'online.fxreader.uv',
|
# 'online.fxreader.uv',
|
||||||
# ['c', 'cpp'],
|
# ['c', 'cpp'],
|
||||||
version: '0.1.5.18',
|
version: '0.1.5.19',
|
||||||
# default_options: [
|
# default_options: [
|
||||||
# 'cpp_std=c++23',
|
# 'cpp_std=c++23',
|
||||||
# # 'prefer_static=true',
|
# # 'prefer_static=true',
|
||||||
|
@ -172,10 +172,19 @@ def check_list(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def check_type(value: Any, VT: Type[Value]) -> Value:
|
def check_type(
|
||||||
assert isinstance(value, VT)
|
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(
|
def pyproject_load(
|
||||||
|
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