fixed wrong generator test

This commit is contained in:
rasbt 2014-04-16 09:55:49 -04:00
parent 2a3d9aa325
commit b47af2f2e6
2 changed files with 16 additions and 16 deletions

View File

@ -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",

View File

@ -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",