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
I was trying to add None to the file but it was not accepting any of these values None, none, null. so i just opened up a interpreter, constructed a dictionary {"s": {'r': None}} and when i used toml.dumps on it the section s contained no field named as r. which was initially set None.
Toml does not seem to raise error on invalid values.
If None is not implemented for now. This is feature request.
The text was updated successfully, but these errors were encountered:
@xcodz-dot I tried your sample dict on toml v0.10.2 in python 3.9.1, and got the same behavior. I think it's a bug.
As of the current TOML standard (v1.0.0rc3), there is no way to assign any kind of null as a value. This was a deliberate design choice. It reflects TOML's primary purpose as a configuration format, and not every type of data can be expressed in TOML, including null-like objects like Python's None.
Perhaps it needs to be discussed as an issue on the standard's project, especially if you want nulls to be allowed, post-v1.0.0. My own take is, nulls are currently invalid in TOML, and can't just be ignored by emitters. So any encoder that attempts to dump None ought to raise an error.
I was trying to add None to the file but it was not accepting any of these values
None
,none
,null
. so i just opened up a interpreter, constructed a dictionary{"s": {'r': None}}
and when i used toml.dumps on it the sections
contained no field named asr
. which was initially set None.Toml does not seem to raise error on invalid values.
If None is not implemented for now. This is feature request.
The text was updated successfully, but these errors were encountered: