Skip to content

Make ParameterSource a proper Python 3 Enum subclass.#1535

Merged
davidism merged 1 commit intopallets:masterfrom
alanbato:parameter-source-enum
Oct 7, 2020
Merged

Make ParameterSource a proper Python 3 Enum subclass.#1535
davidism merged 1 commit intopallets:masterfrom
alanbato:parameter-source-enum

Conversation

@alanbato
Copy link
Contributor

@alanbato alanbato commented Apr 20, 2020

This implements the change proposed in #1530.

I tried to make as few changes as possible, that's why I went and implemented a custom __eq__() to support the current use case inside the library (mostly inside tests)

Any comments and feedback are welcome :)

fixes #1530

@alanbato alanbato force-pushed the parameter-source-enum branch from b02a54e to f5c3ba5 Compare April 20, 2020 18:41
@alanbato alanbato requested a review from ThiefMaster April 20, 2020 23:01
@alanbato alanbato force-pushed the parameter-source-enum branch from 4f7365e to ebcb86e Compare April 20, 2020 23:16
@jab
Copy link
Contributor

jab commented Apr 20, 2020

I tried to make as few changes as possible, that's why I went and implemented a custom eq() to support the current use case inside the library

A reasonable first cut, for sure. But @davidism, not sure if that's what you had in mind. It seems to me that changing the usage sites to do direct enum comparison (rather than having to keep the custom __eq__ implementation here) would be more in the spirit of this change. WDYT?

@ThiefMaster ThiefMaster removed their request for review May 28, 2020 09:07
@davidism davidism added this to the 8.0.0 milestone Jul 1, 2020
@davidism davidism force-pushed the parameter-source-enum branch from ebcb86e to c85f9cd Compare October 7, 2020 14:59
Co-authored-by: David Lord <davidism@gmail.com>
@davidism davidism force-pushed the parameter-source-enum branch from c85f9cd to 3852f41 Compare October 7, 2020 15:03
@davidism davidism added the f:parameters feature: input parameter types label Oct 7, 2020
@davidism davidism merged commit 861e047 into pallets:master Oct 7, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f:parameters feature: input parameter types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make ParameterSource an Enum

4 participants