7 comments (7 comments)2 reactions (2 reactions)0 assignees (0 assignees)Julia5,773 forks (5,773 forks)batch import
collectionsgood first issue
Repository metrics
- Stars
- 48,709 stars (48,709 stars)
- PR merge metrics
- Avg merge 20d 6h (Avg merge 20d 6h)157 merged PRs in 30d (157 merged PRs in 30d)
Description
Currently haskey is defined for NamedTuple but not for Tuple. Would it make sense to also add this for tuples? After all, keys(::Tuple) is also defined.
Code would then probably look like this
haskey(t::Tuple, key) = isdefined(t, key)
Related: https://github.com/JuliaLang/julia/issues/32898
Contributor guide
- Research direction
- Implement `haskey` for `Tuple` by adding a method that uses `isdefined` to check if the tuple has a given key. Look at existing `haskey` implementations for `NamedTuple` for reference.
- Tech stack
- None
- Domain
- api
- Issue type
- Feature
- Prerequisites
- GitJulia