Add haskey
for Vector
#32898
Labels
domain:arrays
[a, r, r, a, y, s]
domain:collections
Data structures holding multiple items, e.g. sets
kind:feature
Indicates new feature / enhancement requests
kind:speculative
Whether the change will be implemented is speculative
In order to write generic code that can use
Vector
andDict
interchangeably, it would be very useful to addhaskey(v, i)
for aVector
v
, to check ifv[i]
exists.Since there is already
keys(v)
for aVector
, this seems consistent.Daniel Berge suggested on Slack to use
i in keys(v)
, which seems to work, but also seems like an unnecessary workaround.The text was updated successfully, but these errors were encountered: