| 1250 | data = data * 100 # make sure we realloc a bit |
| 1251 | |
| 1252 | class MyIter: |
| 1253 | # Class/example from gh-15789 |
| 1254 | def __length_hint__(self): |
| 1255 | # only required to be an estimate, this is legal |
| 1256 | return length_hint # 0 or 1 |
| 1257 | |
| 1258 | def __iter__(self): |
| 1259 | return iter(data) |
| 1260 | |
| 1261 | res = np.fromiter(MyIter(), dtype=dtype) |
| 1262 | expected = np.array(data, dtype=dtype) |
no outgoing calls