Core: Return the function-pointer check directly in _is_flattenable_scalar

Style only, no behaviour change and no IR change. Keeps `ruff check --select
SIM` clean on the files this branch touches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pragyansh Chaturvedi
2026-08-07 05:30:13 +05:30
parent 013907758f
commit 1c349c87b4

View File

@ -58,9 +58,10 @@ def _is_flattenable_scalar(member_type: Any) -> bool:
return False
if issubclass(member_type, (ctypes._Pointer, ctypes.Array)):
return False
if hasattr(member_type, "_restype_") and hasattr(member_type, "_argtypes_"):
return False
return True
is_function_pointer = hasattr(member_type, "_restype_") and hasattr(
member_type, "_argtypes_"
)
return not is_function_pointer
def flatten_anonymous_members(class_obj, dep_node) -> None: