Message170482
| Author |
skrah |
| Recipients |
dabeaz, pitrou, skrah |
| Date |
2012年09月14日.16:01:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1347638483.64.0.949152972898.issue15944@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
0-dim memory is indexed by x[()]. The ctypes example has an additional
problem, because format="<d" is not yet implemented in memoryview.
Only native single character formats in struct module syntax are
implemented, and "<d" in struct module syntax means "standard size,
little endian".
To demonstrate 0-dim indexing, here's an example using _testbuffer:
>>> x = ndarray(3.14, shape=[], format='d', flags=ND_WRITABLE)
>>> x[()]
3.14
>>> tau = 6.28
>>> x[()] = tau
>>> x[()]
6.28
>>> m = memoryview(x)
>>> m[()]
6.28
>>> m[()] = 100.111
>>> m[()]
100.111 |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月14日 16:01:23 | skrah | set | recipients:
+ skrah, pitrou, dabeaz |
| 2012年09月14日 16:01:23 | skrah | set | messageid: <1347638483.64.0.949152972898.issue15944@psf.upfronthosting.co.za> |
| 2012年09月14日 16:01:23 | skrah | link | issue15944 messages |
| 2012年09月14日 16:01:22 | skrah | create |
|