You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
importprotoclassZone(proto.Enum):
LITTORAL=1MESOPELAGIC=2ABYSSAL=3HADEAN=4classSquid(proto.Message):
zone=proto.Field(Zone, number=1)
classTrawl(proto.Message):
squids=proto.RepeatedField(Squid, number=1) # Note: this indirection with the nested field# is necessary to trigger the exception.# Setting the field in an existing message accepts strings AND# checks for valid variants.# Similarly, constructing a message directly with a top level # enum field kwarg passed as a string is also handled correctly, i.e.# s = Squid(zone="ABYSSAL")# does NOT raise an exception.t=Trawl(squids=[{"zone": "HADEAN"}])
generates
TypeError: 'HADEAN' has type str, but expected one of: int, long
This is related to #52, and most of the implementation will probably be shared.