Skip to content

Converter works for IList<T> but not for T[] #601

Closed

Description

@jjaskulowski

Environment

  • Pythonnet version:
  • Python version: all
  • Operating System: all

Details

I lost hours on this.
converter.ToPython() does not enter condition "if (value is IList && value.GetType().IsGenericType)" for arrays so arrays that could be converted to python lists are not being converted.

I think it should also work for any generic and not generic ICollection and any Array.

Instead, it currently treats it as a generic PyObject.

Otherwise, great job!

Activity

  1. den-run-ai commented on Jan 21, 2018

    @den-run-ai
    Contributor

    @jjaskulowski .NET arrays are not the same as Python lists, even .NET lists are not the same as Python lists.
    So technically even what is currently done is not ideal. So what should you do for now? I suggest converting arrays between Python and .NET using some of techniques you can find in this issue tracker.

  2. filmor commented on Jun 14, 2022

    @filmor
    Member

    The list converters work differently now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions