Skip to content

Commit 2f5e1d0

Browse files
authored
doc: >=: say not to implement this function directly (#59504)
The doc string of function `>` already has a similar note. Cross-reference issue GenericMappingTools/GMT.jl#1799.
1 parent 3681bb3 commit 2f5e1d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

base/operators.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,14 @@ const ≤ = <=
453453
454454
Greater-than-or-equals comparison operator. Falls back to `y <= x`.
455455
456+
# Implementation
457+
458+
New types should prefer to implement [`<=`](@ref) instead of this function,
459+
and rely on the fallback definition `>=(x, y) = y <= x`.
460+
461+
Furthermore, in many cases it is enough to implement just [`<`](@ref) and
462+
[`==`](@ref), relying on the fallback definitions of both `<=` and `>=`.
463+
456464
# Examples
457465
```jldoctest
458466
julia> 'a' >= 'b'

0 commit comments

Comments
 (0)