Add use of safe_load() function in README (#285)

It helps people to use `safe_load` if they discover the library.
It's more secure if `safe_load()` is used by default, and `load()` is used if it's necessary (and the developer knows what is does).
This commit is contained in:
sblondon 2019-12-07 22:44:29 +01:00 committed by Tina Müller (tinita)
parent 03b378d039
commit 6549385d53
1 changed files with 4 additions and 0 deletions

4
README
View File

@ -15,6 +15,10 @@ parser and emitter as follows:
>>> yaml.load(stream, Loader=yaml.CLoader)
>>> yaml.dump(data, Dumper=yaml.CDumper)
If you don't trust the input stream, you should use:
>>> yaml.safe_load(stream)
PyYAML includes a comprehensive test suite. To run the tests,
type 'python setup.py test'.