Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is it missing "list of dicts"? All the examples show only lists of simple strings. If so, that seems like a major problem.

Taking the main example, what do you do if you have more than one vice president?



This is the biggest problem with this format! You probably won’t need it for configs, but they are written by engineers which are fine with other formats. For business data missing list of dictionaries is a deal-breaker. This is yet another shallow project similar to dribble-design portfolios of some people: looks cool at first glance, but has so big problems that it won’t fly.


This supposed "biggest problem" doesn't actually exist. Lists of dictionaries work fine, and I don't see any reason they wouldn't be useful for configs either. Maybe you should actually try it before dismissing it so shallowly?

This:

  list of dicts: 
      - 
          key 1: Hi 
          key 2: there! 
      - 
          key 1: I'm a list 
          key 2: of dicts!
parses as

  {'list of dicts': [{'key 1': 'Hi', 'key 2': 'there!'}, {'key 1': "I'm a list", 'key 2': 'of dicts!'}]}


Did you just guess that syntax? It's not in the documentation.

Hidden features effectively do not exist. The parent may have gone overboard with judgement, but this really is the fault of the project maintainers. I'll admit I mentally filed it in the "useless toy" category without this feature.

I went looking for it specifically because it's one of the ugliest and most confusing parts of YAML. To be pathological, what if you have a list of lists?


Sure, the documentation could be improved, but the syntax is extremely simple, consistent, and predictable. A list of lists is also exactly what you would expect:

  list of lists: 
      - 
          - first sublist 
          - goes here 
      - 
          - second sublist 
          - is here 
produces

  {'list of lists': [['first sublist', 'goes here'], ['second sublist', 'is here']]}
I don't think either of these are hidden. Yes, explicit examples would be nice, but assuming things not shown are impossible seems strange to me. Would you assume Python can't do lists of dicts, or lists of dicts of dicts? A quick search fails to find any examples on python.org (I did find lists of lists though).


That syntax is not obvious or predictable, and several people in this commentary made the same assumption. Fix your docs.


I have no connection to this project. I'm speaking purely from my own experience of spending a few minutes looking at the docs and trying a couple of things in Python. The sublists and subdicts were obvious to me as soon as I learned the three forms lines can take. The only thing I wasn't sure about was whether the sublists or subdicts had to start on the next line, so I tried it out: yes they do.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: