Why require a minimum indentation of 2 in yaml.dump() ?

Alan Evangelista <[email protected]> Tue, 14 Mar 2017 17:25:43 -0300
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
I tried to set an indentation of 1 character in yaml.dump() and I got an indentation of 2 characters 
instead.

Reading PyYAML 3.10 code, I found out that the indentation parameter gets passed to the Emitter 
constructor
and then there is the following code at its __init__() method:

        self.best_indent = 2
         if indent and 1 < indent < 10:
             self.best_indent = indent

Why force a range of valid indentation values ?


Regards,
Alan Evangelista


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot