PyFloats should not be implicitly rounded to integers

Environment

  • Pythonnet version: Latest master
  • Python version: 3.7.8
  • Operating System: Windows 10 64-bit
  • .NET Runtime: Core 3.1

Details

Incorrectly passing a float value to a method accepting an integer argument causes the float value to be rounded.

from Python.Test import MethodTest
MethodTest.TestOverloadedNoObject(5.5)

Surprisingly, the above code invokes the method with the integer 5. I expect this to raise an error instead, even if the value passed was 5.0. I expect a method with an integer argument to behave like list indexing in Python, which refuses any float value:

a = [1,2,3]
a[1.0]
TypeError: list indices must be integers or slices, not float