|
2368 | 2368 | { |
2369 | 2369 | "data": { |
2370 | 2370 | "text/plain": [ |
2371 | | - "['e', 'b', 'c', 'g', 'h', 'a', 'f', 'd']" |
| 2371 | + "['h', 'g', 'f', 'e', 'b', 'c', 'd', 'a']" |
2372 | 2372 | ] |
2373 | 2373 | }, |
2374 | 2374 | "execution_count": null, |
|
2855 | 2855 | { |
2856 | 2856 | "data": { |
2857 | 2857 | "text/plain": [ |
2858 | | - "'_mutjsmXKSHeVjFdUFGSgNw'" |
| 2858 | + "'_A4Vwg-8YQl6jO9oSzGbXKQ'" |
2859 | 2859 | ] |
2860 | 2860 | }, |
2861 | 2861 | "execution_count": null, |
|
2952 | 2952 | { |
2953 | 2953 | "data": { |
2954 | 2954 | "text/plain": [ |
2955 | | - "('215346fd', '8c7d7247')" |
| 2955 | + "('ffaa945f', '8c7d7247')" |
2956 | 2956 | ] |
2957 | 2957 | }, |
2958 | 2958 | "execution_count": null, |
|
3714 | 3714 | "name": "stdout", |
3715 | 3715 | "output_type": "stream", |
3716 | 3716 | "text": [ |
3717 | | - "Num Events: 9, Freq/sec: 338.8\n", |
3718 | | - "Most recent: ▆▂▇▁▆ 280.6 255.3 284.5 238.9 279.7\n" |
| 3717 | + "Num Events: 9, Freq/sec: 354.5\n", |
| 3718 | + "Most recent: ▃▃▇▁▅ 267.3 262.4 285.9 244.6 272.8\n" |
3719 | 3719 | ] |
3720 | 3720 | } |
3721 | 3721 | ], |
|
4960 | 4960 | "#| export\n", |
4961 | 4961 | "async def to_aiter(items):\n", |
4962 | 4962 | " \"Async yield each item in `items` with `asyncio.sleep(0)` between\"\n", |
| 4963 | + " import asyncio\n", |
4963 | 4964 | " for item in items:\n", |
4964 | 4965 | " await asyncio.sleep(0)\n", |
4965 | 4966 | " yield item" |
|
5027 | 5028 | "source": [ |
5028 | 5029 | "async def _double(x): return x*2\n", |
5029 | 5030 | "\n", |
5030 | | - "test_eq(await mapa(lambda x: x*2, [1,2,3]), [2,4,6]) # sync f, sync items\n", |
| 5031 | + "test_eq(await mapa(mul(2), [1,2,3]), [2,4,6]) # sync f, sync items\n", |
5031 | 5032 | "test_eq(await mapa(_double, [1,2,3]), [2,4,6]) # async f, sync items\n", |
5032 | | - "test_eq(await mapa(lambda x: x*2, _agen()), [2,4,6]) # sync f, async items\n", |
| 5033 | + "test_eq(await mapa(mul(2), _agen()), [2,4,6]) # sync f, async items\n", |
5033 | 5034 | "test_eq(await mapa(_double, _agen()), [2,4,6]) # async f, async items" |
5034 | 5035 | ] |
5035 | 5036 | }, |
|
0 commit comments