Quiz on JSONEncoder repr Method in Python



1. What is the purpose of the JSONEncoder __repr__ method in Python?
2. What does the default implementation of __repr__ return for JSONEncoder?
3. Can the __repr__ method be overridden in a subclass of JSONEncoder?
4. Which module in Python provides the JSONEncoder class?
5. What kind of outputs can you expect when using the __repr__ method on a JSONEncoder instance?

Advertisements