Inconsistency
The Python SDK's load_markets() assigns self.markets_by_slug[market.slug] = market without checking whether market.slug is None, causing a TypeError (unhashable type NoneType) or KeyError at runtime. The TypeScript SDK correctly guards this assignment.
Current (PMXT)
sdks/python/pmxt/client.py — load_markets() method:
self.markets_by_slug[market.slug] = market # slug can be None → TypeError
TypeScript SDK correctly guards this:
// core/src/BaseExchange.ts (TypeScript)
if (market.slug) {
this.marketsBySlug[market.slug] = market;
}
Expected (CCXT convention)
CCXT's loadMarkets skips index entries when the key is falsy. The Python SDK should mirror the TypeScript guard:
if market.slug:
self.markets_by_slug[market.slug] = market
Impact
Any venue that does not set slug on returned markets (e.g. Kalshi markets) will cause load_markets() to raise a TypeError in Python, making the entire exchange instance unusable. This is a runtime crash, not just a type mismatch.
Found by automated PMXT ↔ CCXT API consistency audit
Inconsistency
The Python SDK's
load_markets()assignsself.markets_by_slug[market.slug] = marketwithout checking whethermarket.slugisNone, causing aTypeError(unhashable typeNoneType) orKeyErrorat runtime. The TypeScript SDK correctly guards this assignment.Current (PMXT)
sdks/python/pmxt/client.py—load_markets()method:TypeScript SDK correctly guards this:
Expected (CCXT convention)
CCXT's
loadMarketsskips index entries when the key is falsy. The Python SDK should mirror the TypeScript guard:Impact
Any venue that does not set
slugon returned markets (e.g. Kalshi markets) will causeload_markets()to raise aTypeErrorin Python, making the entire exchange instance unusable. This is a runtime crash, not just a type mismatch.Found by automated PMXT ↔ CCXT API consistency audit