Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

better enum support + fix for enum34 IntEnum quirk #121

Merged
merged 2 commits into from
Aug 5, 2016

Conversation

ezarowny
Copy link
Contributor

@ezarowny ezarowny commented Aug 4, 2016

@ezarowny ezarowny force-pushed the better-enum-support branch from 0f5644f to 89bbb94 Compare August 4, 2016 21:59
# backport enum34 which causes it to not have the same
# behavior as Python 3.4+. One way to identify IntEnums is that
# they are instances of numbers but not number types.
if isinstance(o, integer_types + (float,)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth creating a global number_types so we aren't constantly creating new tuples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's probably true - not a bad idea at all

@coryvirok
Copy link
Contributor

👍

@ezarowny
Copy link
Contributor Author

ezarowny commented Aug 5, 2016

cc @dlsteuer

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants