Skip to content

Commit d69a6ac

Browse files
Make readonly array through typing only.
As title.
1 parent 0401550 commit d69a6ac

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎numba/np/arrayobj.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2589,16 +2589,13 @@ def impl(arr):
25892589

25902590
@intrinsic
25912591
def _force_readonly(tyctx, arr):
2592-
"""Takes an array, and returns it with the readonly bit set in both typing
2593-
and lowering."""
2592+
"""Takes an array, and returns it with the readonly bit set through
2593+
typing"""
25942594
sig = arr.copy(readonly=True)(arr)
25952595

25962596
def impl(cgctx, builder, sig, llargs):
25972597
arrayty = make_array(arr)
25982598
array = arrayty(cgctx, builder, llargs[0])
2599-
# make readonly hack
2600-
parent = array._datamodel.get_type('parent')
2601-
setattr(array, 'parent', Constant(cgctx.get_value_type(parent), None))
26022599
return impl_ret_borrowed(cgctx, builder, sig.return_type,
26032600
array._getvalue())
26042601
return sig, impl

0 commit comments

Comments
 (0)