"Data blocks" syntax specification draft

Christian Gollwitzer auriocus at gmx.de
Tue May 22 02:01:05 EDT 2018


Am 22.05.18 um 04:17 schrieb Mikhail V:
> On Mon, May 21, 2018 at 1:41 PM, Chris Lindsay via Python-list
> <python-list at python.org> wrote:
> 
>> If a block of static data is large enough to start to be ugly, a common
>> approach is to load the data from some other file, in a language which is
>> designed around structured data.
> 
> 
> Maybe it is common in industrial applications but not in smaller production,
> and according to my observation not common at all in all occasional scripts.
> 
>> YAML comes to mind
> 
> Actually plugging a data syntax in existing language is not a new idea.
> Though I don't know real success stories.
> 

Thing is, you can do it already now in the script, without modifying the 
Python interpreter, by parsing a triple-quoted string. See the examples 
right here: http://pyyaml.org/wiki/PyYAMLDocumentation

	Christian



More information about the Python-list mailing list