toml-lang/toml

Proposal: Null type values for TOML

amaank404 opened this issue ยท 6 comments

Adding Null type values
Pro:

  • Allows null or any other name for it to be used in such cases
    [[author]]
    email = null
    name = "Lorem Ipsum"
    bookname = "dolor sit amet"
    website = "https:///www.lipsum.com/"
    
    [[author]]
    email = "unknown@email.com"
    name = "Eiusmod Tempor"
    bookname = "Iusto Odio"
    website = null

Cons:

  • it might not look so human freindly but null can be replaced as none, nothing, etc.

I'm intentionally holding my tongue for now. In any case, this is a post-v1.0.0 issue.

@xcodz-dot See:

  • #146 In favor of NULL
  • #30 nil or null values

Personally I don't think there's a meaningful difference between an explicit null and just not adding the value to the config to begin with.

Great for me now, I will figure out a way to customize the python side toml for my needs

Personally I don't think there's a meaningful difference between an explicit null and just not adding the value to the config to begin with.

My take (and this came up in uiri/toml) was that a Python None value cannot be converted to any comparable value in TOML, and that any encoder that encounters None should raise an error.

I don't believe nulls belong in configurations. They're the wrong tool for the job, and they're more trouble than they're worth. That's why I consider them invalid.

That doesn't necessarily extend to other uses, but even in SQL, nulls are a pain. And most SQL variants use strongly typed columns and variables; a NULL in context has an underlying data type. Nulls in a config would just be dead weight.

nulls are a pain

Amen. Nullability is always such a PITA

jab commented

Some issues caused by not having null are discussed in this thread: https://twitter.com/mitsuhiko/status/1346455555435593729