From e2203b3bfd1f5f4b50cbda69ac32a6396747be7b Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 27 Oct 2026 14:42:52 +0000 Subject: [PATCH] docs: explain capability inheritance and defaults --- synpath/base.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/synpath/base.py b/synpath/base.py index df08d58..b12eba0 100644 --- a/synpath/base.py +++ b/synpath/base.py @@ -477,10 +477,14 @@ def _clean(params: Any) -> Any: def complete_capabilities(cls: type) -> None: - """Fill `cls.has` from `CAPABILITIES`, refusing typos and illegal values. + """Build a complete `cls.has` map for every name in `CAPABILITIES`. - Shared by the read adapters and the trading adapters, so both answer - every question the same way. See `Exchange.__init_subclass__`. + Validate the class's own declarations, rejecting unknown capability names + and illegal values. Inherit from the nearest ancestor in method resolution + order with a non-empty `has` dictionary, then apply the class's overrides. + Capabilities declared by neither default to `False`. + + Shared by read, trading and WebSocket adapters during subclass creation. """ declared = cls.__dict__.get("has", {}) if not isinstance(declared, dict):