type_check
is_roughly_correct_type(obj, type_) ¶
Check if obj is roughly correct type.
The roughly correct type means that the first element of the sequence and mapping only checked.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj | Any | target object | required |
type_ | Any | target type | required |
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool | True if obj is roughly correct type, otherwise False |
Source code in jijmodeling_transpiler/utils/type_check.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
raise_type_error(var_name, obj, type_) ¶
Raise TypeError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj | Any | target object | required |
type_ | Any | target type | required |
Source code in jijmodeling_transpiler/utils/type_check.py
5 6 7 8 9 10 11 12 13 14 15 16 | |