Skip to content

Commit 54aa1f9

Browse files
committed
splits import, fixed reduce NameError for python3
1 parent fb86c36 commit 54aa1f9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

boolean/boolean.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,21 @@
2626

2727
import inspect
2828
import itertools
29-
from operator import and_ as and_operator, or_ as or_operator
29+
from operator import and_ as and_operator
30+
from operator import or_ as or_operator
3031

3132

3233
try:
3334
basestring # Python 2
3435
except NameError:
3536
basestring = str # Python 3
3637

38+
try:
39+
reduce # Python 2
40+
except NameError:
41+
from functools import reduce # Python 3
42+
43+
3744
# Set to True to enable tracing for parsing
3845
TRACE_PARSE = False
3946

0 commit comments

Comments
 (0)