mirror of
https://github.com/Xevion/thesaurus-scraper.git
synced 2025-12-06 01:16:35 -06:00
12 lines
270 B
Python
12 lines
270 B
Python
import demjson
|
|
|
|
|
|
class CustomJSON(demjson.JSON):
|
|
"""
|
|
A simple override for the demjson.JSON class to map all instances of undefined into 'null'.
|
|
"""
|
|
|
|
def encode_undefined(self, state):
|
|
"""Return null as undefined."""
|
|
state.append('null')
|