Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong method chosen if argument is passed as keyword argument #1235

Closed
@danabr

Description

@danabr

Environment

  • Pythonnet version: 2.5.0
  • Python version: 3.7
  • Operating System: Windows 10

Details

namespacePython.Test{publicclassMethodArityTest{publicstringFoo(inta){return"Arity 1";}publicstringFoo(inta,intb){return"Arity 2";}}}
deftest_keyword_arg_method_resolution():"""Test correct method is chosen using keyword arguments"""fromPython.TestimportMethodArityTestob=MethodArityTest()assertob.Foo(1,b=2)=="Arity 2"

The test above fails with:

    def test_keyword_arg_method_resolution():        """Test correct method is chosen using keyword arguments"""        from Python.Test import MethodArityTest        ob = MethodArityTest()>       assert ob.Foo(1, b=2) == "Arity 2"E       AssertionError: assert 'Arity 1' == 'Arity 2'E         - Arity 1E         ?       ^E         + Arity 2E         ?       ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp