Project

General

Profile

Actions

Feature #14044

closed

Introduce a new attribute `step` in Range

Added by mrkn (Kenta Murata) about 7 years ago. Updated over 6 years ago.

Status:
Rejected
Target version:
-
[ruby-core:83517]

Description

As described in #13904, Numo::NArray and PyCall touches internal structure of Enumerator to obtain the argument of Range#step.
This information is necessary to realize the same manner of the utilization of Python's slices.

In this ticket, I propose to introduce the new attribute step in an instance of Range class.
Its role is same as the step attribute of Python's slice.

Range#step should be changed to return a new Range object with the given step value instead of an Enumerator.
The default value of step attribute is nil, and it means that step is 1.


Related issues 3 (1 open2 closed)

Related to Ruby master - Feature #13904: getter for original information of EnumeratorClosedmrkn (Kenta Murata)Actions
Related to Ruby master - Feature #3714: Add getters for EnumeratorClosedknu (Akinori MUSHA)Actions
Related to Ruby master - Feature #9049: Shorthands (a:b, *) for inclusive indexingOpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0