mirror of
https://github.com/rasbt/python_reference.git
synced 2025-01-18 23:37:07 +00:00
fixed wrong generator test
This commit is contained in:
parent
2a3d9aa325
commit
b47af2f2e6
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"metadata": {
|
||||
"name": "",
|
||||
"signature": "sha256:39951e0d86a78e2a0068b01db48a79c51e896c8f05c69e387c77e0fb68eaec41"
|
||||
"signature": "sha256:ae2429a793f28d6caf410da8ce5690a243070d84b5eb141245c096e374c168d5"
|
||||
},
|
||||
"nbformat": 3,
|
||||
"nbformat_minor": 0,
|
||||
|
@ -1115,11 +1115,11 @@
|
|||
" print(i)\n",
|
||||
"\n",
|
||||
"def test_generator(generator):\n",
|
||||
" for i in listcompr:\n",
|
||||
" for i in generator:\n",
|
||||
" print(i)\n",
|
||||
"\n",
|
||||
"def test_generator_yield(generator_yield):\n",
|
||||
" for i in listcompr:\n",
|
||||
" for i in generator_yield:\n",
|
||||
" print(i)\n",
|
||||
"\n",
|
||||
"print('plain_list: ', end = '')\n",
|
||||
|
@ -1138,7 +1138,7 @@
|
|||
"output_type": "stream",
|
||||
"stream": "stdout",
|
||||
"text": [
|
||||
"plain_list: 10000000 loops, best of 3: 26.2 ns per loop"
|
||||
"plain_list: 10000000 loops, best of 3: 54.5 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1147,7 +1147,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"listcompr: 10000000 loops, best of 3: 26.1 ns per loop"
|
||||
"listcompr: 10000000 loops, best of 3: 54.4 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1156,7 +1156,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"generator: 10000000 loops, best of 3: 25.9 ns per loop"
|
||||
"generator: 10000000 loops, best of 3: 56.8 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1165,7 +1165,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"generator_yield: 10000000 loops, best of 3: 26 ns per loop"
|
||||
"generator_yield: 10000000 loops, best of 3: 52.4 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1176,7 +1176,7 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 76
|
||||
"prompt_number": 1
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"metadata": {
|
||||
"name": "",
|
||||
"signature": "sha256:39951e0d86a78e2a0068b01db48a79c51e896c8f05c69e387c77e0fb68eaec41"
|
||||
"signature": "sha256:ae2429a793f28d6caf410da8ce5690a243070d84b5eb141245c096e374c168d5"
|
||||
},
|
||||
"nbformat": 3,
|
||||
"nbformat_minor": 0,
|
||||
|
@ -1115,11 +1115,11 @@
|
|||
" print(i)\n",
|
||||
"\n",
|
||||
"def test_generator(generator):\n",
|
||||
" for i in listcompr:\n",
|
||||
" for i in generator:\n",
|
||||
" print(i)\n",
|
||||
"\n",
|
||||
"def test_generator_yield(generator_yield):\n",
|
||||
" for i in listcompr:\n",
|
||||
" for i in generator_yield:\n",
|
||||
" print(i)\n",
|
||||
"\n",
|
||||
"print('plain_list: ', end = '')\n",
|
||||
|
@ -1138,7 +1138,7 @@
|
|||
"output_type": "stream",
|
||||
"stream": "stdout",
|
||||
"text": [
|
||||
"plain_list: 10000000 loops, best of 3: 26.2 ns per loop"
|
||||
"plain_list: 10000000 loops, best of 3: 54.5 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1147,7 +1147,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"listcompr: 10000000 loops, best of 3: 26.1 ns per loop"
|
||||
"listcompr: 10000000 loops, best of 3: 54.4 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1156,7 +1156,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"generator: 10000000 loops, best of 3: 25.9 ns per loop"
|
||||
"generator: 10000000 loops, best of 3: 56.8 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1165,7 +1165,7 @@
|
|||
"text": [
|
||||
"\n",
|
||||
"\n",
|
||||
"generator_yield: 10000000 loops, best of 3: 26 ns per loop"
|
||||
"generator_yield: 10000000 loops, best of 3: 52.4 ns per loop"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1176,7 +1176,7 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"prompt_number": 76
|
||||
"prompt_number": 1
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
|
|
Loading…
Reference in New Issue
Block a user