3 ms·
Their dictionaries and arrays split into ini-like sections are not very readable though. The double [[ is just nasty and not possible to apply in all situations
by viraptor 2y ago
Their dictionaries and arrays split into ini-like sections are not very readable though. The double [[ is just nasty and not possible to apply in all situations (array in map in array).
- zahlman 2y ago> not possible to apply in all situations (array in map in array). Yes, that's largely why inline tables and arrays exist: >>> tomllib.loads(""" ... [[outer]] ... first = [1, 2, 3] ... second = [4, 5, 6] ... ... [[outer]] ... third = [7, 8, 9] ... fourth = [10, 11, 12] ... """) {'outer': [{'first': [1, 2, 3], 'second': [4, 5, 6]}, {'third': [7, 8, 9], 'fourth': [10, 11, 12]}]}
- lifthrasiir 2y agoTOML explicitly disallows newlines in inline tables, so that's not a full solution (if you agree that there are some situations where multi-line inline tables are indeed required).