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

Python handling of C# collection #1785

Closed
Milestone
@Martin-Molinero

Description

@Martin-Molinero

Environment

  • Pythonnet version: master/3.0
  • Python version: *
  • Operating System: *
  • .NET Runtime: *

Details

  • Describe what you were trying to get done.

Seems that sinceCollectionMixinsProvider was added this case started failing (if key in collection.Keys:), not sure whyCollectionMixinsProvider is required, if this is a bug or not..
Test passes commenting outhttps://github.com/pythonnet/pythonnet/blob/master/src/runtime/InteropConfiguration.cs#L24

classATests{privatestaticdynamiccontainsTest;privatestaticstringtestModule=@"from clr import AddReferenceAddReference(""System"")AddReference(""Python.EmbeddingTest"")def ContainsTest(key, collection):    if key in collection.Keys:        return True    return False";[OneTimeSetUp]publicvoidSetup(){PythonEngine.Initialize();varpyModule=PyModule.FromString("module",testModule);containsTest=pyModule.GetAttr("ContainsTest");}[TestCase("AAPL",false)][TestCase("SPY",true)]publicvoidContainsTest(stringkey,boolexpected){vardic=newDictionary<string,object>{{"SPY",newobject()}};Assert.AreEqual(expected,(bool)containsTest(key,dic));}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp