Dashboard › Knowledge › Function signatures: abstract types in,…
019fb3b9-f510-7968-8177-ab1b3e7ee214Directive (Burak Yigit Kaya, 2026-07-30): for function signatures, use abstract types for input parameters and concrete types for return types. Examples: Sequence (or Iterable) over list for params; list (or dict, set) over Sequence for returns. Reasoning: callers should be able to pass any compatible type (list/tuple/generator), and the function's return contract should be precise about the produced shape. This is the Python type-hint equivalent of "accept-the-widest, return-the-narrowest".