DashboardKnowledgeFunction signatures: abstract types in,…

Function signatures: abstract types in, concrete types out (Peedro convention)

Category: preference
Confidence: 1.00
ID: 019fb3b9-f510-7968-8177-ab1b3e7ee214
Project ID: (global)
Cross-project: Yes
Recalled in other projects: 0
Source session: 0rWXqG93IDSIFMxki
Created: 2026-07-30 15:52:16
Updated: 2026-07-30 15:52:16

Content

Directive (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".

Move to: