Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

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

Closed
adrienguerard opened this issue Mar 31, 2016 · 3 comments
Closed

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

adrienguerard opened this issue Mar 31, 2016 · 3 comments

Comments

@adrienguerard
Copy link
Contributor

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.

@bmuller
Copy link
Owner

bmuller commented Mar 31, 2016

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

@adrienguerard
Copy link
Contributor Author

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

@adrienguerard
Copy link
Contributor Author

#68

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants