This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jakirkham
Recipients jakirkham, veky
Date 2022-01-13.19:54:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642103692.11.0.320538567007.issue41226@roundup.psfhosted.org>
In-reply-to
Content
The 2nd argument is the `strides`. IOW it is just specifying how to traverse the buffer in memory to visit each of the dimensions.

For the first example where `strides` is not specified, Python makes them C-ordered. IOW `m2.strides` would be `(3, 1)`. Effectively this is represented like this:

```
[[ b"a", b"c", b"e"],
 [ b"b", b"d', b"f"]]
```

For the second case where strides are overridden (so `m2.strides` would be `(1, 2)`), we get something like this:

```
[[b"a", b"b", b"c"],
 [b"d", b"e", b"f"]]
```

In either case the `1` here has specified which dimension is fastest to traverse along. IOW that content is adjacent in memory.

Should add the reason it is `1` is that for `uint8_t` (or format "B"), this is that type's size. If we had a different format, this would be the size of that format.

HTH
History
Date User Action Args
2022-01-13 19:54:52jakirkhamsetrecipients: + jakirkham, veky
2022-01-13 19:54:52jakirkhamsetmessageid: <1642103692.11.0.320538567007.issue41226@roundup.psfhosted.org>
2022-01-13 19:54:52jakirkhamlinkissue41226 messages
2022-01-13 19:54:52jakirkhamcreate