Allow creating new .NET arrays from Python using Array[T](dim1, dim2,…) syntax by lostmsu · Pull Request #1291 · pythonnet/pythonnet

What does this implement/fix? Explain your changes.

This handles a few new argument combinations in tp_new of .NET array types:

  1. A single integer to create a one-dimensional array of specified size.
  2. Multiple integers passed as arguments (e.g. Array[T](3,5,7)) to create a multidimensional array.

It processes all exceptions specified in https://docs.microsoft.com/en-us/dotnet/api/system.array.createinstance?view=net-5.0#System_Array_CreateInstance_System_Type_System_Int64___

Does this close any currently open issues?

fixes #251

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG