pentschev · GitHub

added 9 commits

July 23, 2020 08:41
This new function allows dispatching from C directly, while also
implementing the new `like=` argument, requiring only minimal
changes to existing array creation functions that need to add
support for that argument.
The implementation uses array_implement_c_array_function, thus
introducing minimal complexity to the original _array_fromobject
code.
np.asarray can rely on np.array's C dispatcher instead.
Tests comprise some of the functions that have been implemented already:
* np.array (C dispatcher)
* np.asarray (indirect C dispatcher via np.array)
* np.full (Python dispatcher)
* np.ones (Python dispatcher)

shoyer

This was referenced

Jul 23, 2020

Merged

Closed

@pentschev

eric-wieser

eric-wieser

eric-wieser

Replace PyUnicode_FromString by PyUnicode_InternFromString to cache
"like" string.
Check and handle errors on importing NumPy's Python functions
Using Python dispatcher for all of them. Using the C dispatcher
directly on the `np.array` call can result in incorrect behavior.
Incorrect behavior may happen if the downstream library's
implementation is different or if not all keyword arguments are
supported.

eric-wieser

eric-wieser

eric-wieser

…mentation

eric-wieser

eric-wieser

eric-wieser

@pentschev

Open

This was there for a bit, but the same thing can already be
achieved without the parameter, so that it is now unused.

@seberg

eric-wieser

Merged

Closed

Closed

Open

@pentschev

@mhvk mhvk mentioned this pull request

Apr 17, 2021

Open

4 tasks

Closed

Merged

Read the original on github.com ↗