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
JSON5 is gaining wider use as it has a few nice features. It would be nice to be able to use this library with JSON5 strings.
Possible solution
Two proposals:
change the from_json to use a generic json parser (or even just generic parser if we wanna have some fun). This could be a global variable, a function passed in on the annotation, or a function passed in at the time of calling from_json
Add a new method called from_json5.
The first is nice as we can keep bloat out of the code base, and let the end user manually set things. The latter is nice as it minimizes effort for the end user.
In my fork, I took the second approach, while also adding a from_json5f to allow passing in a file/IO object.
Alternatives
Right not, the solution is to load the object into a dict using json5.load, and then pass the dictionary into the from_dict method.
Context
No response
The text was updated successfully, but these errors were encountered:
Description
JSON5 is gaining wider use as it has a few nice features. It would be nice to be able to use this library with JSON5 strings.
Possible solution
Two proposals:
from_json
to use a generic json parser (or even just generic parser if we wanna have some fun). This could be a global variable, a function passed in on the annotation, or a function passed in at the time of callingfrom_json
from_json5
.The first is nice as we can keep bloat out of the code base, and let the end user manually set things. The latter is nice as it minimizes effort for the end user.
In my fork, I took the second approach, while also adding a
from_json5f
to allow passing in a file/IO object.Alternatives
Right not, the solution is to load the object into a dict using
json5.load
, and then pass the dictionary into thefrom_dict
method.Context
No response
The text was updated successfully, but these errors were encountered: