commit | d752f7d8e851eb6160bbb1bb0e506652ec037f10 | [log] [tgz] |
---|---|---|
author | Neal Norwitz <nnorwitz@gmail.com> | Fri Nov 25 03:17:59 2005 +0000 |
committer | Neal Norwitz <nnorwitz@gmail.com> | Fri Nov 25 03:17:59 2005 +0000 |
tree | a31a2bd153f529be28c4172602d6f5abebf76f31 | |
parent | f9232678aede501ea6cde3bbbcb08de068c16153 [diff] [blame] |
No need for types, use isinstance
diff --git a/Lib/compiler/misc.py b/Lib/compiler/misc.py index 6d5eaa8..8d91770 100644 --- a/Lib/compiler/misc.py +++ b/Lib/compiler/misc.py
@@ -1,9 +1,8 @@ -import types def flatten(tup): elts = [] for elt in tup: - if type(elt) == types.TupleType: + if isinstance(elt, tuple): elts = elts + flatten(elt) else: elts.append(elt)