1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
--- a/python/_harppy.py
+++ b/python/_harppy.py
@@ -34,6 +34,7 @@
import glob
import numpy
import os
+from functools import reduce
try:
from cStringIO import StringIO
@@ -277,7 +278,7 @@
return name in self._variable_dict
def __repr__(self):
- return "<Product variables=%r>" % self._variable_dict.keys()
+ return "<Product variables=%r>" % list(self._variable_dict.keys())
def __str__(self):
stream = StringIO()
@@ -472,9 +473,9 @@
This method is Python 2 and Python 3 compatible.
"""
try:
- return dictionary.iteritems()
+ return iter(list(dictionary.items()))
except AttributeError:
- return dictionary.items()
+ return list(dictionary.items())
def _get_py_dimension_type(dimension_type):
|