[stubtest] Verify all exists in stub by srittau · Pull Request #18005 · python/mypy (original) (raw)

1.14 introduced a change that our __init__.py doesn't, and can't comply with.

Our __init__.py looks like this:

_exported_symbols.extend([
    "Value",
    "NullValue",
    "BooleanValue",
    "UnsignedBinaryValue",
    "UnsignedShortValue",
    "UnsignedIntegerValue",
    "UnsignedLongValue",
    "BinaryValue",
    "ShortValue",
    "IntegerValue",
    "LongValue",
    "HugeIntegerValue",
    "FloatValue",
    "DoubleValue",
    "DecimalValue",
    "StringValue",
    "UUIDValue",
    "BitValue",
    "BlobValue",
    "DateValue",
    "IntervalValue",
    "TimestampValue",
    "TimestampSecondValue",
    "TimestampMilisecondValue",
    "TimestampNanosecondValue",
    "TimestampTimeZoneValue",
    "TimeValue",
    "TimeTimeZoneValue",
])

__all__ = _exported_symbols

Which I'm pretty sure is non-standard, and creates a warning, but this works for us

Mypy is not happy about this because it seems __all__ is expected to be a constant expression, and expected to be copied to the __init__.pyi file