Johannes Bauer <dfnsonfsdu...@gmx.de> writes:
> def myorder(x):
>      if type(x[0]) == int:
>          return x[0]
>      else:
>          return x[0][0]

I used to write code like that pretty regularly, but over time I found
that it's better to stay consistent and use the same container format
(in this case, tuples) for everything, rather than having special
cases for the singleton and non-singleton case.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to