summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/compiler/misc.py')
-rw-r--r--Lib/compiler/misc.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/compiler/misc.py b/Lib/compiler/misc.py
index a281c10..dae42d4 100644
--- a/Lib/compiler/misc.py
+++ b/Lib/compiler/misc.py
@@ -1,3 +1,14 @@
+import types
+
+def flatten(tup):
+ elts = []
+ for elt in tup:
+ if type(elt) == types.TupleType:
+ elts = elts + flatten(elt)
+ else:
+ elts.append(elt)
+ return elts
+
class Set:
def __init__(self):
self.elts = {}