Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for YAML. Simple Dict by tom-tom
def yaml(text):
def transform(value):
try:
return int(value)
except ValueError:
return value
return {key: transform(value) for key, _, value in (map(str.strip, line.partition(':')) for line in text.splitlines()) if value}
Aug. 7, 2019
Comments: