- Notifications
You must be signed in to change notification settings - Fork749
Closed
Description
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.
fromPython.TestimportMethodTestMethodTest.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 was5.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:listindicesmustbeintegersorslices,notfloat
Metadata
Metadata
Assignees
Labels
No labels