pyrsistent
pyrsistent copied to clipboard
Allow positional arguments in `m`
The other collections have a way to construct them without going through some other data structure first. PMap does too, but it only works if the keys are string identifiers. If you need some other type of key, then you'd have to construct a dict first.
Clojure has a hash-map constructor that doesn't require some other mapping. If m could accept positional arguments, it could work the same way: args[::2] would be the keys and args[1::2] would be values. This could be in addition to the kwargs it already accepts, so it would not be a breaking change.