Add a comment to custom yaml_safe_load() method.
@@ -26,6 +26,13 @@ __all__ = ["ALLOWED_EXTS", "PARSER_FUNCS"]
# NOTE: We utilize CSafeLoader if available since it uses C extensions and is faster.
+#
+# SafeLoader / CSafeLoader are both safe to use and don't allow loading arbitrary Python objects.
+#
+# That's the actual class which is used internally by ``yaml.safe_load()``, but we can't use that
+# method directly since we want to use C extension if available (CSafeLoader) for faster parsing.
+#
+# See pyyaml docs for details https://pyyaml.org/wiki/PyYAMLDocumentation
def yaml_safe_load(stream):
return yaml.load(stream, Loader=YamlSafeLoader)
