Closed singularitti closed 3 years ago
Will you consider adding configurations of JSON & YAML?
No. There's already from_dict
and to_dict
, supporting these two should be easy in a new package or just write it as an one-liner. This package should not have a heavy dep, I support TOML mainly because it is shipped with Julia.
How about naming to_file when you want to save to a file, from_file when you want to load from a file, and from_string when you want to load from a string, and to_string, etc.?
since I will only support TOML in this package, there is no need to make it generic I think.
Just one question: should toml
be renamed to to_toml
? Like from_dict
& to_dict
.
yes, can you submit a PR for this?
Sure, but this is a breaking change, is it? Should I make an alias to toml
for backward compatibility? Or just upgrade to version 0.10.0?
please also add a deprecation warning for toml
, we can further discuss this in the PR.
In the current implementation,
toml
can either return aString
or write to a file. But infrom_toml
, the argumentString
can only refer to a file, not a valid TOML string. This raises inconsistency of naming convention. Will you consider adding configurations of JSON & YAML? What naming convention should they follow? How about namingto_file
when you want to save to a file,from_file
when you want to load from a file, andfrom_string
when you want to load from a string, andto_string
, etc.?