8000 Disable implicit conversion from float to array index by tminka · Pull Request #1363 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Disable implicit conversion from float to array index #1363

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

Merged
merged 1 commit into from
Jan 21, 2021

Conversation

tminka
Copy link
Contributor
@tminka tminka commented Jan 21, 2021

What does this implement/fix? Explain your changes.

A float value as an array index will raise an error. Fixes an oversight in #1343

Does this close any currently open issues?

The comment in #1342

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@@ -320,6 +338,11 @@ public static new int mp_ass_subscript(IntPtr ob, IntPtr idx, IntPtr v)
return 0;
}

private static IntPtr RaiseTypeError(IntPtr idx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: RaiseIndexMustBeIntegerError

@tminka tminka force-pushed the no-implicit-float-to-index branch from 4f18f9e to 657d675 Compare January 21, 2021 20:44
@lostmsu lostmsu merged commit 32fdc9c into pythonnet:master Jan 21, 2021
@tminka tminka deleted the no-implicit-float-to-index branch January 21, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0