Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait, really? scrambles to check woah...

I've never seen typed yaml, this is wild.

    negative: !!int -12
    zero: !!int 0
    positive: !!int 34
Can't say I love the notation, but indeed that is type annotations. I guess neither "yaml type hints" nor "yaml type annotations" are the right query. Had to search explicitly for "yaml tags".


The neat thing is that you can use tags to represent custom data structures or functions. For example, AWS Cloudformation uses YAML tags as a shorthand for template functions [0].

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...


Depending on the parser you can also use them to call arbitrary code. This used to be the default behavior of `pyyaml.load`.


Types are !!screaming at reader. Don't want to start blameshitting, but is yaml supposed to be a simple human-readable format?


It is screaming with double negations!


It's not screaming without double negations!!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: