From 80ab42462e94025f69db38c9359c65d108ebb51b Mon Sep 17 00:00:00 2001 From: flavio-b Date: Thu, 20 Mar 2025 18:24:02 -0700 Subject: [PATCH] [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. --- range.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/range.c b/range.c index 50a35d4964..12077a068e 100644 --- a/range.c +++ b/range.c @@ -2661,14 +2661,14 @@ range_overlap(VALUE range, VALUE other) * end * a # => [2, 4, 6, 8, 10] * - * A range can be both beginless and endless. For literal beginless, endless + * A range can be both beginless and endless. For literal beginless, endless * ranges, at least the beginning or end of the range must be given as an * explicit nil value. It is recommended to use an explicit nil beginning and - * implicit nil end, since that is what Ruby uses for Range#inspect: + * end, since that is what Ruby uses for Range#inspect: * - * (nil..) # => (nil..) - * (..nil) # => (nil..) - * (nil..nil) # => (nil..) + * (nil..) # => (nil..nil) + * (..nil) # => (nil..nil) + * (nil..nil) # => (nil..nil) * * == Ranges and Other Classes *