Skip to content

Array instantiation does not work with clean syntax #251

@den-run-ai

Description

@den-run-ai

According to readme array can be instantiated like this:

http://pythonnet.github.io/readme.html

from System import Array
myarray = Array[int](10)

However this syntax stopped working and instead need to use one of two options:

list(Array.CreateInstance(int,10)) # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

or

list(Array[int](range(10))) #[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions