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

Use isinstance rather than type when type-checking #96

Open
richcooper95 opened this issue Feb 2, 2022 · 0 comments
Open

Use isinstance rather than type when type-checking #96

richcooper95 opened this issue Feb 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@richcooper95
Copy link

Describe the bug
Some places use type() instead of isinstance() when checking types (e.g. here). Using isinstance() is preferred because it's faster and also considers inheritance (and you’d probably want to still consider subclasses of dict as true in that example above - e.g. if we wanted to use an OrderedDict).

To Reproduce
n/a

Expected behavior
Check types with isinstance() instead.

System (please complete the following information):
n/a

Additional context
n/a

@richcooper95 richcooper95 added the enhancement New feature or request label Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant