bmuller/twistar

Change type checks to use "isinstance" instead of "is"

Closed this issue · 3 comments

Hello bmuller,

I'm using twistar in my project, and encountered an issue; I'm using the 2/3 compatibility pip package "future", and it includes a wrapper around 2's list class to behave like 3's. As long as all type-checking is done via "isinstance", this doesn't cause any problems. However, you're using "is list" here: dbconfig/base.py#L392 . This causes AssertionErrors to get thrown when passing in a list constructed from the future.builtins package. Considering changing the other type-checks to use isinstance might not be a bad idea, as it's the preferred type-check is most cases, I've found.

Hey @adrienguerard - sure, that sounds like a great idea. If you close this ticket and submit a PR I'd happily immediately merge it :)

I'll submit a PR today or tomorrow. Thanks!