Skip to content

Commit 1852c97

Browse files
committed
fixed wrong generator test
1 parent b47af2f commit 1852c97

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

.ipynb_checkpoints/not_so_obvious_python_stuff-checkpoint.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:ae2429a793f28d6caf410da8ce5690a243070d84b5eb141245c096e374c168d5"
4+
"signature": "sha256:9b684ae1d67b480d34f80c15b281859c0bc91e94b26b941fa04ce142f3505c5d"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -1108,19 +1108,19 @@
11081108
"input": [
11091109
"def test_plainlist(plain_list):\n",
11101110
" for i in plain_list:\n",
1111-
" print(i)\n",
1111+
" pass\n",
11121112
"\n",
11131113
"def test_listcompr(listcompr):\n",
11141114
" for i in listcompr:\n",
1115-
" print(i)\n",
1115+
" pass\n",
11161116
"\n",
11171117
"def test_generator(generator):\n",
11181118
" for i in generator:\n",
1119-
" print(i)\n",
1119+
" pass\n",
11201120
"\n",
11211121
"def test_generator_yield(generator_yield):\n",
11221122
" for i in generator_yield:\n",
1123-
" print(i)\n",
1123+
" pass\n",
11241124
"\n",
11251125
"print('plain_list: ', end = '')\n",
11261126
"%timeit test_plainlist\n",
@@ -1138,7 +1138,7 @@
11381138
"output_type": "stream",
11391139
"stream": "stdout",
11401140
"text": [
1141-
"plain_list: 10000000 loops, best of 3: 54.5 ns per loop"
1141+
"plain_list: 10000000 loops, best of 3: 55.6 ns per loop"
11421142
]
11431143
},
11441144
{
@@ -1147,7 +1147,7 @@
11471147
"text": [
11481148
"\n",
11491149
"\n",
1150-
"listcompr: 10000000 loops, best of 3: 54.4 ns per loop"
1150+
"listcompr: 10000000 loops, best of 3: 54.8 ns per loop"
11511151
]
11521152
},
11531153
{
@@ -1165,7 +1165,7 @@
11651165
"text": [
11661166
"\n",
11671167
"\n",
1168-
"generator_yield: 10000000 loops, best of 3: 52.4 ns per loop"
1168+
"generator_yield: 10000000 loops, best of 3: 54.7 ns per loop"
11691169
]
11701170
},
11711171
{
@@ -1176,7 +1176,7 @@
11761176
]
11771177
}
11781178
],
1179-
"prompt_number": 1
1179+
"prompt_number": 2
11801180
},
11811181
{
11821182
"cell_type": "code",

not_so_obvious_python_stuff.ipynb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:ae2429a793f28d6caf410da8ce5690a243070d84b5eb141245c096e374c168d5"
4+
"signature": "sha256:9b684ae1d67b480d34f80c15b281859c0bc91e94b26b941fa04ce142f3505c5d"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -1108,19 +1108,19 @@
11081108
"input": [
11091109
"def test_plainlist(plain_list):\n",
11101110
" for i in plain_list:\n",
1111-
" print(i)\n",
1111+
" pass\n",
11121112
"\n",
11131113
"def test_listcompr(listcompr):\n",
11141114
" for i in listcompr:\n",
1115-
" print(i)\n",
1115+
" pass\n",
11161116
"\n",
11171117
"def test_generator(generator):\n",
11181118
" for i in generator:\n",
1119-
" print(i)\n",
1119+
" pass\n",
11201120
"\n",
11211121
"def test_generator_yield(generator_yield):\n",
11221122
" for i in generator_yield:\n",
1123-
" print(i)\n",
1123+
" pass\n",
11241124
"\n",
11251125
"print('plain_list: ', end = '')\n",
11261126
"%timeit test_plainlist\n",
@@ -1138,7 +1138,7 @@
11381138
"output_type": "stream",
11391139
"stream": "stdout",
11401140
"text": [
1141-
"plain_list: 10000000 loops, best of 3: 54.5 ns per loop"
1141+
"plain_list: 10000000 loops, best of 3: 55.6 ns per loop"
11421142
]
11431143
},
11441144
{
@@ -1147,7 +1147,7 @@
11471147
"text": [
11481148
"\n",
11491149
"\n",
1150-
"listcompr: 10000000 loops, best of 3: 54.4 ns per loop"
1150+
"listcompr: 10000000 loops, best of 3: 54.8 ns per loop"
11511151
]
11521152
},
11531153
{
@@ -1165,7 +1165,7 @@
11651165
"text": [
11661166
"\n",
11671167
"\n",
1168-
"generator_yield: 10000000 loops, best of 3: 52.4 ns per loop"
1168+
"generator_yield: 10000000 loops, best of 3: 54.7 ns per loop"
11691169
]
11701170
},
11711171
{
@@ -1176,7 +1176,7 @@
11761176
]
11771177
}
11781178
],
1179-
"prompt_number": 1
1179+
"prompt_number": 2
11801180
},
11811181
{
11821182
"cell_type": "code",

0 commit comments

Comments
 (0)