Code review comment for lp:~rackspace-titan/nova/osapi-serialization

Revision history for this message
Ed Leafe (ed-leafe) wrote :

> > If you add a #TODO to those lines, sure.
>
> I'm not sure what I would say the TODO is. I don't see a clear path to "fix"
> this, and I think most people could argue both sides of the type vs.
> isinstance debate.

type() has known limitations with old-style classes; isinstance() does not. Additionally, type() check does not take into account subclassing; isinstance() does. There is no clean way to check for a string object with type() due to types.StringType and types.UnicodeType; you can use isinstance(val, basestring) to check for all string types.

So who are the people who are arguing both sides? :)

« Back to merge proposal