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

.NET class instances considered Iterable #1234

Closed
@danabr

Description

@danabr

Environment

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

Details

All .NET class instances are considered instances ofcollections.abc.Iterable.

namespacePython.Test{publicclassEmpty{}}
deftest_not_Iterable():"""Test regular .NET objects are not iterable"""fromPython.TestimportEmptyfromcollections.abcimportIterableassert (notisinstance(Empty(),Iterable))

The test is expected to pass, but fails:

    def test_not_Iterable():        """Test regular .NET objects are not iterable"""        from Python.Test import Empty        from collections.abc import Iterable>       assert (not isinstance(Empty(), Iterable))E       AssertionError: assert not TrueE        +  where True = isinstance(<Python.Test.Empty object at 0x0000022D3E6DE5C8>, <class 'collections.abc.Iterable'>)E        +    where <Python.Test.Empty object at 0x0000022D3E6DE5C8> = <class 'Python.Test.Empty'>()

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