Multiple ChoiceHard 30s
json Custom Encoder
Choose the best answer for: JSON serialization of custom objects
Options
- 1Define a custom encoder class inheriting JSONEncoder
- 2Use str() on the object, since json.dumps accepts it directly
- 3Custom objects are always serializable, Python introspects them
- 4JSON can serialize any Python object without a custom encoder
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.