this post was submitted on 27 Jun 2023
19 points (100.0% liked)

Python

6400 readers
20 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
19
TOML in Python (til.simonwillison.net)
submitted 1 year ago by sisyphean to c/python
top 9 comments
sorted by: hot top controversial new old
[–] jim 3 points 1 year ago* (last edited 1 year ago) (3 children)

I think yaml was a perfectly fine way to express a hash/dict like config. I am surprised that toml was so widely adopted by the community.

[–] [email protected] 6 points 1 year ago (1 children)

Yaml is fine until you want to abbreviate Norway and get false... toml doesn't handle everything well but at least it doesn't have insane problems like that.

[–] Andy 4 points 1 year ago (1 children)

While that shouldn't happen with a current-spec YAML parser, I agree even the current spec does way too much with types.

I've come to love NestedText's approach of leaving all type handling to the ingesting code.

[–] jnovinger 3 points 1 year ago (1 children)

You should make a post about NestedText. That looks interesting and pretty close to my own internal note-taking style.

[–] Andy 1 points 1 year ago (1 children)

Would you suggest a topic or tooling to pair with it, so I can provide a good demo for working with it in a real and useful context?

I made a CLI tool for working with it but want to avoid making a look-at-me spammy post, and I think the NestedText site itself explains the ideas pretty well already.

[–] jnovinger 3 points 1 year ago

First, I have to apologize, I just meant post a link to NestText as a post in c/Python. I definitely didn't mean to imply you should have to go write a blog post (or something) about it just for me. I swear this was just an attempt to get another person posting interesting things to c/Python. 😬

Looking through the community projects and docs, the use cases/tooling that really stood out to me were:

Thinking about how I might use it:

[–] sisyphean 6 points 1 year ago* (last edited 1 year ago)

YAML is extremely complex for a configuration format and it has many really weird edge cases:

https://noyaml.com/

The problem is IMHO made worse because it looks so friendly at first glance.

[–] GTG3000 5 points 1 year ago

As someone who had tried to wrap their mind around YAML spec...

Fuck yaml. It is ridiculous how much junk there is in that spec.

[–] itadakimasu 2 points 1 year ago

I love toml. It's so natural. I use it all the time (for smaller configs)