Skip to content

Commit 80ab424

Browse files
flavio-bnobu
authored andcommitted
[DOC] beginless and endless ranges inspect returns "nil..nil" always
Small correction to the Range docs. All beginless (nil..) and endless (..nil) ranges, as well as fully open ranges (nil..nil), display "nil..nil" when inspected, regardless of their original syntax.
1 parent 65bc0ec commit 80ab424

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

range.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,14 +2661,14 @@ range_overlap(VALUE range, VALUE other)
26612661
* end
26622662
* a # => [2, 4, 6, 8, 10]
26632663
*
2664-
* A range can be both beginless and endless. For literal beginless, endless
2664+
* A range can be both beginless and endless. For literal beginless, endless
26652665
* ranges, at least the beginning or end of the range must be given as an
26662666
* explicit nil value. It is recommended to use an explicit nil beginning and
2667-
* implicit nil end, since that is what Ruby uses for Range#inspect:
2667+
* end, since that is what Ruby uses for Range#inspect:
26682668
*
2669-
* (nil..) # => (nil..)
2670-
* (..nil) # => (nil..)
2671-
* (nil..nil) # => (nil..)
2669+
* (nil..) # => (nil..nil)
2670+
* (..nil) # => (nil..nil)
2671+
* (nil..nil) # => (nil..nil)
26722672
*
26732673
* == Ranges and Other Classes
26742674
*

0 commit comments

Comments
 (0)