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

Skip to content

range: 'range' object is not subscriptable #46

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
corona10 opened this issue Dec 28, 2018 · 4 comments
Closed

range: 'range' object is not subscriptable #46

corona10 opened this issue Dec 28, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@corona10
Copy link
Collaborator

Range object should support get_item operation :)

gpython

>>> a = range(10)
>>> a[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
TypeError: "'range' object is not subscriptable"

python3

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = range(10)
>>> a[0]
0
@ncw ncw added the bug Something isn't working label Dec 29, 2018
@ncw
Copy link
Collaborator

ncw commented Dec 29, 2018

I can't imagine why you'd want to do that, but yes it looks like a bug :-)

@corona10
Copy link
Collaborator Author

corona10 commented Dec 29, 2018

@ncw
Oh, I am finding out feature with not compatible with cpython3.
so sometimes I write something strange code.
And this bug was found from practical code and this code is just an essential part of the bug to reproduce.

@ncw
Copy link
Collaborator

ncw commented Dec 29, 2018

@ncw
Oh, I am finding out feature with not compatible with cpython3.
so sometimes I write something strange code.
And this bug was found from practical code and this code is just an essential part of the bug to reproduce.

I see!

In idea: at some point we could use go-fuzz to find code which doesn't behave the same way in gpython and python3.

@corona10
Copy link
Collaborator Author

@ncw Yeah it would be a good choice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants