-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…27749) * Add keytype method for AbstractArray and AbstractVector The function `keytype(a)` returns `eltype(keys(a))` for associative structures; it should do the same for `Abstract{Array, Vector}`. * Add keytype method for AbstractArray and AbstractVector (part 2) Now also for the type, not just for objects. * Add valtype(...) for arrays Arrays are associative structures in the sense that keys(...) and values(...) both work on them. When considering them as such, their valtype should be equal to eltype. (A future version of Julia could even do `const valtype = eltype`?) * Implement keytype/valtype for object as keytype(typeof(... As suggested by @mbauman in code review. Co-Authored-By: tkluck <tkluck@infty.nl> * Implement keytype/valtype for ranges * Add test cases for keytype/valtype(::AbstractArray) * Add #27749 to NEWS.md * keytype/valtype for arrays: docs + compat annotation * keytype/valtype: use String values in examples this makes the distinction between key and value clearer. Thanks to @StefanKarpinski for suggesting this. Co-Authored-By: tkluck <tkluck@infty.nl> * keytype/valtype for arrays: no special treatment for ranges This was a little red herring in the discussion in #27749: the `length` of a range may depend on the type of its parameters, but as it turns out, `eltype(keys(...))` does not. That's arguably a bug/inconsistency, but it's outside of the scope of this pull request to fix that.
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ce17e05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Executing the daily benchmark build, I will reply here when finished:
@nanosoldier
runbenchmarks(ALL, isdaily = true)
ce17e05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan