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
class BaseModel:
pass
class Field:
def __init__(self, *args, **kwds):
pass
class ServiceRow(BaseModel):
"""An individual record."""
service_id: int = Field(..., description="The ID for the service.", alias="id")
name: str = Field(..., description="Displayable Name for the service.")
Fails at runtime with
name: str = Field(..., description="Displayable Name for the service.")
TypeError: Expected str, got Field
Generated C code includes
if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(0, 12, __pyx_L1_error)
Expected behavior
It's just regular Python code - it shouldn't enforce the types
Environment (please complete the following information):
Describe the bug +To Reproduce
From the users mailing list (https://groups.google.com/g/cython-users/c/R4YQzdIOPSQ):
Fails at runtime with
Generated C code includes
Expected behavior
It's just regular Python code - it shouldn't enforce the types
Environment (please complete the following information):
Additional context
Bisect suggests b2b81c9 (slightly unsurprisingly).
The text was updated successfully, but these errors were encountered: