add flatten helper function
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 = {}