This error (and others) is the sort of behavior that leads me to suspect a straightforward JSON implementation underneath it all.
The “natural” representation of a dict
is as a JSON Object. But in Data types and syntax, it is shown that a JSON Object’s keys are always strings.
When a dict
contains a date
(or other non-JSON type), we get similar errors.
The code to detect such cases would have to be executed on every call, even in that majority of cases where it is unnecessary. This suggests a two-level scheme, whereby existing calls are left alone, and run at top speed; but an extended version of @anvil.server.callable
lets us identify those few cases where more care (and time) is necessary.