Skip to content

Commit

Permalink
Set numpy writable flag to false for immutable view
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Jul 30, 2024
1 parent 1278042 commit cde6d05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/numcodecs-python/src/pycodec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Codec for PyCodec {
data.call_method(
intern!(py, "setflags"),
(),
Some(&[(intern!(py, "write"), true)].into_py_dict_bound(py)),
Some(&[(intern!(py, "write"), false)].into_py_dict_bound(py)),
)?;
let data = data.call_method0(intern!(py, "view"))?;

Expand Down Expand Up @@ -159,7 +159,7 @@ impl Codec for PyCodec {
encoded.call_method(
intern!(py, "setflags"),
(),
Some(&[(intern!(py, "write"), true)].into_py_dict_bound(py)),
Some(&[(intern!(py, "write"), false)].into_py_dict_bound(py)),
)?;
let encoded = encoded.call_method0(intern!(py, "view"))?;

Expand Down

0 comments on commit cde6d05

Please sign in to comment.