# Stubtest allowlist for the `thetadatadx` Python wheel (Gate 6 / #549).
#
# The hand-written `__init__.pyi` covers the load-bearing public
# surface — clients, credentials, the fluent `Contract` /
# `Subscription` / `SecType` types, the typed FPSS event payload
# classes, streaming context managers, the FlatFiles namespace, the
# typed exception hierarchy. Generator-emitted classes (100+
# historical builders, 50+ typed `<Tick>List` / `<Tick>ListIter`
# wrappers, every enum produced by
# `coerce::register_string_enums`, etc.) are exposed via the
# module-level `__getattr__` fallback to `Any` because a hand-typed
# mirror would be high-maintenance noise that drifts on every
# codegen pass.
#
# The CI gate runs::
#
#     python -m mypy.stubtest thetadatadx \
#         --allowlist sdks/python/stubtest_allowlist.txt \
#         --ignore-missing-stub \
#         --ignore-disjoint-bases \
#         --ignore-positional-only
#
# `--ignore-missing-stub` covers the generator-emitted surface (the
# hundreds of classes the stub deliberately doesn't enumerate).
# `--ignore-disjoint-bases` is a PEP 800 marker stubtest emits on
# every pyo3 class; pyclasses are always disjoint by construction.
# `--ignore-positional-only` covers the asymmetry between pyo3's
# `def (self, value, /)` and the human-readable `def __eq__(self,
# other)` we write in stubs.
#
# Remaining false positives below — all stem from pyo3 routing
# constructor parameters through `__new__` while the user-facing
# documentation talks about `__init__` (the practical user-visible
# signature is identical; mypy.stubtest reports both halves of the
# swap as drift).

# pyo3 routes every pyclass constructor through `__new__`. The
# stub documents the equivalent `__init__` signature because that
# is what the user sees in `help()`, in IDE autocomplete, and in
# the rendered Sphinx docs. Allow both halves of the
# `__init__ / __new__` swap on every pyclass that has a non-trivial
# constructor.
thetadatadx\.Credentials\.__init__
thetadatadx\.Credentials\.__new__
thetadatadx\.Client\.__init__
thetadatadx\.Client\.__new__
thetadatadx\.AsyncClient\.__init__
thetadatadx\.AsyncClient\.__new__
thetadatadx\.AsyncClient\.__getattr__
# `Client.__getattr__` is intentionally NOT stubbed —
# every public method on the unified client is hand-listed in the
# .pyi so stubtest catches drift on the load-bearing pyclass (C6
# closure). Generator-emitted historical builders reach the module
# via the module-level `__getattr__` instead.
thetadatadx\.StreamingClient\.__init__
thetadatadx\.StreamingClient\.__new__
thetadatadx\.HistoricalClient\.__init__
thetadatadx\.HistoricalClient\.__new__
thetadatadx\.HistoricalClient\.__getattr__
thetadatadx\.StreamingSession\.__getattr__

# `__exit__` on pyo3 context managers carries default values for
# the three positional args at runtime (matching `Optional[...] = None`
# semantics). The hand-written stub elides the defaults because the
# user is never going to call `__exit__` directly. Allow the swap.
thetadatadx\..*\.__exit__

# `EventCallback` is a `Callable[..., None]` alias declared in the
# stub for documentation purposes — it never appears at runtime
# (there is no runtime use that needs it as a value).
thetadatadx\.EventCallback

# `StreamEvent` is a type alias declared in the stub for
# documentation purposes — it never appears at runtime (there is
# no runtime use that needs it as a value).
thetadatadx\.StreamEvent
