Summary
Many caller-facing signatures annotate a parameter as non-Optional but default it to None (implicit-Optional), which PEP 484 disallows and which mypy flags by default (implicit-optional off since mypy 0.990).
Examples
datamaxi/resources/cex_candle.py:37-38 — from_unix: str = None, to_unix: str = None
datamaxi/resources/cex_ticker.py:30-31
datamaxi/resources/funding_rate.py:33-34,110-111
datamaxi/resources/premium.py:29-49
- Inconsistent even within one signature —
cex_candle.py:111: exchange: str = None, market: Optional[Market] = None
Fix
Sweep resource (and async mirror) signatures: param: str = None → param: Optional[str] = None. Purely a typing correctness change, no runtime behavior change. Pairs naturally with shipping py.typed (#<py.typed issue>) so the corrected hints are actually consumed.
Surfaced during a pythonic-idiom review of the SDK.
Summary
Many caller-facing signatures annotate a parameter as non-
Optionalbut default it toNone(implicit-Optional), which PEP 484 disallows and which mypy flags by default (implicit-optional off since mypy 0.990).Examples
datamaxi/resources/cex_candle.py:37-38—from_unix: str = None,to_unix: str = Nonedatamaxi/resources/cex_ticker.py:30-31datamaxi/resources/funding_rate.py:33-34,110-111datamaxi/resources/premium.py:29-49cex_candle.py:111:exchange: str = None, market: Optional[Market] = NoneFix
Sweep resource (and async mirror) signatures:
param: str = None→param: Optional[str] = None. Purely a typing correctness change, no runtime behavior change. Pairs naturally with shippingpy.typed(#<py.typed issue>) so the corrected hints are actually consumed.Surfaced during a pythonic-idiom review of the SDK.