Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Slice function of range type must be supported #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HyeockJinKim opened this issue Sep 11, 2019 · 2 comments · Fixed by #83
Closed

Slice function of range type must be supported #77

HyeockJinKim opened this issue Sep 11, 2019 · 2 comments · Fixed by #83
Assignees

Comments

@HyeockJinKim
Copy link
Contributor

a = range(10)
d = a[10:11]
print(d)

Unlike the list type, the range type does not support the slice function. slice in the range type must be supported.

Expected result

range(10, 10)

Actual result

TypeError: "unsupported operand type(s) for index: 'slice'"
2019/09/11 23:10:28 TypeError: "unsupported operand type(s) for index: 'slice'"
@HyeockJinKim
Copy link
Contributor Author

If this issue is valid, Can I try this issue?

@corona10
Copy link
Collaborator

@HyeockJinKim go a head :)

HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 15, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 15, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 15, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 16, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 17, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
HyeockJinKim added a commit to HyeockJinKim/gpython that referenced this issue Sep 26, 2019
Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes go-python#77
corona10 pushed a commit that referenced this issue Sep 26, 2019
* Add Slice function for range type

Crate a new range object by calculating start,
stop, and step when slice is entered as argument
to the __getitem__ function of the range

Fixes #77

* Add typecall for __index__ in Index function

If __index__ is defined when class is used
as index value, __index__ value is used.

* Add tests for range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants