Skip to content

Commit 4d8facd

Browse files
bkaminsnalimilan
andauthored
require get for DataAPI.invrefpool support (#34)
* require `get` for DataAPI.invrefpool support * Update Project.toml * Update src/DataAPI.jl Co-authored-by: Milan Bouchet-Valat <[email protected]> Co-authored-by: Milan Bouchet-Valat <[email protected]>
1 parent 241a203 commit 4d8facd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DataAPI"
22
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
33
authors = ["quinnj <[email protected]>"]
4-
version = "1.5.0"
4+
version = "1.5.1"
55

66
[compat]
77
julia = "1"

src/DataAPI.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ for which `refpool(A)` is not `nothing`:
8080
* for any valid index `ix` into `invrefpool(A)` , `refpool(A)[invrefpool(A)[ix]]` is equal to `ix`
8181
(according to `isequal`) and of the same type as `ix`.
8282
83-
Additionally it is required that `haskey` is defined for `invrefpool(A)`,
84-
allowing to check if `ix` is a valid index into it.
83+
Additionally it is required that for `invrefpool(A)` the following methods are defined:
84+
85+
* `Base.haskey`: allowing to check if `ix` is a valid index into it.
86+
* `Base.get`: allowing to get a value from it or a passed default value if it is not present.
8587
8688
By default, `invrefpool(A)` returns `nothing`.
8789

0 commit comments

Comments
 (0)