Re: YAML 2.0: drop arbitrary nodes to be used as keys
Peter Murphy <[email protected]> Wed, 2 Mar 2016 21:06:39 +1000
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <CANZ_uBjPFavSJfqPbH3r9OyOzTZ5toem9JdcAKnSnY-u4fuQYw@mail.gmail.com> |
On Wed, Mar 2, 2016 at 8:23 PM, Andrey Somov <[email protected]> wrote: > Hi all, > even though it looks like a powerful feature, it gives nothing. > > This should be removed: > Note that YAML allows arbitrary nodes to be used as keys. In particular, a > key may be a sequence or a mapping. Thus, without the above restrictions, > practical one-pass parsing would have been impossible to implement. > > The reason is not that it makes it impossible to convert YAML to JSON. > The reason is that it must never be used. YAML should not advocate > collections (often mutable data structures) as keys. > Of course, the related restrictions, like "1024 rule" or "key is restricted > to a single line", are also gone. > The key must be a scalar. Point. Whatever it is. > No. Tuples are immutables in Python, and can be used as keys in Python dictionaries. There are also immutable sets in Python, which can map as a dictionary where all the matching values are null. There are Python parser (like PyYAML) which happily deal with the expanded nature of "keys". Please. No. > Cheers, > Andrey Best regards, Peter > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Yaml-core mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/yaml-core > -- Email: [email protected] WWW: http://www.pkmurphy.com.au/ ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140