Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Null type values for TOML #802

Closed
amaank404 opened this issue Jan 5, 2021 · 6 comments
Closed

Proposal: Null type values for TOML #802

amaank404 opened this issue Jan 5, 2021 · 6 comments

Comments

@amaank404
Copy link

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 = "[email protected]"
    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.
@eksortso
Copy link
Contributor

eksortso commented Jan 5, 2021

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

@marzer
Copy link
Contributor

marzer commented Jan 5, 2021

@xcodz-dot See:

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.

@amaank404
Copy link
Author

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

@eksortso
Copy link
Contributor

eksortso commented Jan 5, 2021

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.

@marzer
Copy link
Contributor

marzer commented Jan 5, 2021

nulls are a pain

Amen. Nullability is always such a PITA

@jab
Copy link

jab commented Jan 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants