launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #13015
Re: [Merge] lp:~jameinel/maas/maasclient-multipart into lp:maas
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/5/2012 12:25 PM, Jeroen T. Vermeulen wrote:
> Checking for a list seems dangerously fragile: what of tuples,
> result sets, generators..? Is there no better way to distinguish
> this special case?
>
Well, list is all I needed. :)
You can do:
try:
iter(foo)
except TypeError
but then you still need to check for string and unicode first, because
both of them are also iterable,and you don't want to send stuff one
character at a time.
isinstance(obj, (list, tuple, set, ...)) is also a possibility, though
I would probably stick with "if someone needs X, they can add support
for X".
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Cygwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlBunIsACgkQJdeBCYSNAAOVcACeLxLab12/sqr8yqsMt7I1Nwra
jeUAoKwoHGu7sB5zZjpt9B6NIOTs5JOY
=tS+u
-----END PGP SIGNATURE-----
--
https://code.launchpad.net/~jameinel/maas/maasclient-multipart/+merge/128176
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jameinel/maas/maasclient-multipart into lp:maas.
References