-
Notifications
You must be signed in to change notification settings - Fork 95
Handle the non-integer return of __index__ #97
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
==========================================
+ Coverage 69.64% 69.91% +0.26%
==========================================
Files 60 60
Lines 10810 10817 +7
==========================================
+ Hits 7529 7563 +34
+ Misses 2750 2729 -21
+ Partials 531 525 -6
Continue to review full report at Codecov.
|
@corona10 |
Does this also affect the >>> l = [1,2]
>>> class C:
... def __index__(self):
... return 1
...
>>> l[C()]
2 If your change has an influence on this, you could add a test for list, too. |
Generate TypeError when __index__ return non-integer value Fixes go-python#96
When an error occurs, the error is returned and when the value is none the slice's values have a default value.
Add tests for __index__ in list, tuple, string
9ee72dd
to
313242b
Compare
@Tim-St |
@HyeockJinKim Looks good, I think it should work now! |
That looks great now - thank you :-) |
Generate TypeError when index return non-integer value
Fixes #96