File
sdks/python/pmxt/_exchanges.py
Note: This supplements #564, which covers signature_type: Optional[Any] in Polymarket.__init__. The gap below is distinct: all 16 exchange constructors in this file are missing -> None.
Missing Return Types (CRITICAL — all public constructors)
PEP 484 requires __init__ to be annotated -> None. Every generated exchange class constructor is missing this annotation. When disallow_untyped_defs = true is enabled (#246), mypy will reject all 16 at once.
| Line |
Class |
| 13 |
Polymarket.__init__ |
| 70 |
Limitless.__init__ |
| 116 |
Kalshi.__init__ |
| 147 |
KalshiDemo.__init__ |
| 178 |
Probable.__init__ |
| 224 |
Baozi.__init__ |
| 252 |
Myriad.__init__ |
| 283 |
Opinion.__init__ |
| 317 |
Metaculus.__init__ |
| 345 |
Smarkets.__init__ |
| 376 |
PolymarketUS.__init__ |
| 407 |
Hyperliquid.__init__ |
| 438 |
GeminiTitan.__init__ |
| 476 |
SuiBets.__init__ |
| 510 |
Mock.__init__ |
| 536 |
Router.__init__ (generated alias) |
Generator Note
This file is auto-generated by core/scripts/generate-python-exchanges.js. The fix must be applied to the generator template, not the generated file directly, or it will be overwritten on the next npm run generate:sdk:all.
Impact
- CRITICAL: These are the primary user-facing constructors —
Polymarket(...), Kalshi(...), etc. All 16 will fail mypy with disallow_untyped_defs = true enabled.
- IDEs that read
__init__ annotations to populate hover documentation will show incomplete type information for every exchange class.
Suggested Fix
In the generator template, add -> None to each __init__ signature:
def __init__(
self,
api_key: Optional[str] = None,
...
) -> None:
Found by automated Python type hints audit
File
sdks/python/pmxt/_exchanges.pyMissing Return Types (CRITICAL — all public constructors)
PEP 484 requires
__init__to be annotated-> None. Every generated exchange class constructor is missing this annotation. Whendisallow_untyped_defs = trueis enabled (#246), mypy will reject all 16 at once.Polymarket.__init__Limitless.__init__Kalshi.__init__KalshiDemo.__init__Probable.__init__Baozi.__init__Myriad.__init__Opinion.__init__Metaculus.__init__Smarkets.__init__PolymarketUS.__init__Hyperliquid.__init__GeminiTitan.__init__SuiBets.__init__Mock.__init__Router.__init__(generated alias)Generator Note
This file is auto-generated by
core/scripts/generate-python-exchanges.js. The fix must be applied to the generator template, not the generated file directly, or it will be overwritten on the nextnpm run generate:sdk:all.Impact
Polymarket(...),Kalshi(...), etc. All 16 will fail mypy withdisallow_untyped_defs = trueenabled.__init__annotations to populate hover documentation will show incomplete type information for every exchange class.Suggested Fix
In the generator template, add
-> Noneto each__init__signature:Found by automated Python type hints audit