Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new const arrays / ndarray.setflags #4478

Open
allComputableThings opened this issue Aug 23, 2019 · 0 comments
Open

Support for new const arrays / ndarray.setflags #4478

allComputableThings opened this issue Aug 23, 2019 · 0 comments

Comments

@allComputableThings
Copy link

AFAIK, there's no way to return a new const-array from an njit function:

import numba
import numpy as np
@numba.jit(nopython=True)
def f():
    x = np.empty(10, dtype=np.bool_)
    x.setflags(write=False)  # Unknown attribute 'setflags' of type array(bool, 1d, C)
    return x
f()

Immutability is fundamental to safe, well designed, easy-to-reason-about APIs, and would a helpful addition.

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

No branches or pull requests

2 participants