Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
methodcaller solution in Creative category for YAML. Simple Dict by flpo
from operator import methodcaller
def yaml(a):
res = {}
for key, value in map(methodcaller('split', ': '), filter(None, a.splitlines())):
res[key] = int(value) if value.isnumeric() else value
return res
Nov. 10, 2019
Comments: