I have been googling for half an hour with no luck. In python, a is b
can check whether a
and b
refer to the same object. What’s the counterpart in julia?
help?> ===
search: === == .== !==
===(x,y) -> Bool
≡(x,y) -> Bool
Determine whether x and y are identical, in the sense that no program could
distinguish them. Compares mutable objects by address in memory, and
compares immutable objects (such as numbers) by contents at the bit level.
This function is sometimes called egal.
julia> a = [1, 2]; b = [1, 2];
julia> a == b
true
julia> a === b
false
julia> a === a
true
1 Like
Thank you. Very useful.