pyrsistent icon indicating copy to clipboard operation
pyrsistent copied to clipboard

Allow positional arguments in `m`

Open gilch opened this issue 2 years ago • 0 comments

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.

gilch avatar Apr 04 '23 04:04 gilch