Skip to content

Commit

Permalink
Update: Handle UnknownDataType as typing.Any (nutti#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
nutti committed Dec 28, 2022
1 parent 606be5d commit b89516c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fake_bpy_module/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,13 +1232,13 @@ def _get_refined_data_type_fast(
variable_kind: str) -> 'DataType':
# pylint: disable=R0912,R0911,R0915
if re.match(r"^\s*$", dtype_str):
return UnknownDataType()
return ModifierDataType("typing.Any")

if re.match(r"^(type|object|function)$", dtype_str):
return UnknownDataType()
return ModifierDataType("typing.Any")

if re.match(r"^Depends on function prototype", dtype_str):
return UnknownDataType()
return ModifierDataType("typing.Any")

if re.match(r"^(any|Any type.)$", dtype_str):
return ModifierDataType("typing.Any")
Expand Down Expand Up @@ -1926,7 +1926,7 @@ def parse_modifier(string_to_parse: str) -> Tuple[List[str], str]:
return dtype_list[0]
if len(dtype_list) >= 2:
return MixinDataType(dtype_list)
return UnknownDataType()
return ModifierDataType("typing.Any")

def get_refined_data_type(
self, data_type: 'DataType', module_name: str,
Expand Down

0 comments on commit b89516c

Please sign in to comment.