summaryrefslogtreecommitdiffstatshomepage
path: root/tests/bench
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2014-12-20 16:37:40 +0100
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-01-01 14:53:23 +0200
commit12340147b0ace7c1feeaf36b618c92652bdb849f (patch)
tree7bb43cac6b4c46f27607e5ac7a1dabfaf5db31c1 /tests/bench
parent8422cac0888ed9694ec84f3bac8d6edc3d39e911 (diff)
downloadmicropython-12340147b0ace7c1feeaf36b618c92652bdb849f.tar.gz
micropython-12340147b0ace7c1feeaf36b618c92652bdb849f.zip
py: Use sequence of strings for named tuple initialization
- remove single string initialization style - take list of strings instead - store list in the type for fast lookup
Diffstat (limited to 'tests/bench')
-rw-r--r--tests/bench/var-8-namedtuple-1st.py2
-rw-r--r--tests/bench/var-8.1-namedtuple-5th.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/bench/var-8-namedtuple-1st.py b/tests/bench/var-8-namedtuple-1st.py
index 7c4099ac62..f3f36f415a 100644
--- a/tests/bench/var-8-namedtuple-1st.py
+++ b/tests/bench/var-8-namedtuple-1st.py
@@ -1,7 +1,7 @@
import bench
from _collections import namedtuple
-T = namedtuple("Tup", "num bar")
+T = namedtuple("Tup", ["num", "bar"])
def test(num):
t = T(20000000, 0)
diff --git a/tests/bench/var-8.1-namedtuple-5th.py b/tests/bench/var-8.1-namedtuple-5th.py
index 2cd6d15a0d..b6bdc8d795 100644
--- a/tests/bench/var-8.1-namedtuple-5th.py
+++ b/tests/bench/var-8.1-namedtuple-5th.py
@@ -1,7 +1,7 @@
import bench
from _collections import namedtuple
-T = namedtuple("Tup", "foo1 foo2 foo3 foo4 num")
+T = namedtuple("Tup", ["foo1", "foo2", "foo3", "foo4", "num"])
def test(num):
t = T(0, 0, 0, 0, 20000000)