Among all of the built-in types supported by PyYAML, the only one I am finding myself missing is the
frozenset type. I want this specifically because it is hashable, so I can use it as a dictionary key. I am currently able to use
!!python/object/apply:frozenset, which works fine, but given that
frozenset is built-in like
set, it makes sense to support
!!python/fronzenset. (If nothing else, it would be nice to document it and save others the trouble of figuring it out.)
Additionally, would it make sense to coerce a YAML
!!set to a
!!python/frozenset when a hashable key is needed? Since you cannot currently use a
!!set as a key, adding this ability would be backwards-compatible, I think, so it would not be a breaking change.
nodes: by_label: ? !!python/object/apply:frozenset ? 'character' ? 'major' : - name: "Beezus Quimby" description: "Older Sister" - name: "Ramona Quimby" description: "Pesky Little Sister"