Re: Functions as Enum member values

2021-05-31 Thread Colin McPhail via Python-list
> On 31 May 2021, at 18:24, Peter Otten <__pete...@web.de> wrote: > > On 31/05/2021 17:57, Colin McPhail via Python-list wrote: >> Hi, >> According to the enum module's documentation an Enum-based enumeration's >> members can have values of any type: >> "Member values can be anything: int

Re: Functions as Enum member values

2021-05-31 Thread Peter Otten
On 31/05/2021 17:57, Colin McPhail via Python-list wrote: Hi, According to the enum module's documentation an Enum-based enumeration's members can have values of any type: "Member values can be anything: int, str, etc.." You didn't read the fineprint ;) """ The rules for what is all

Functions as Enum member values

2021-05-31 Thread Colin McPhail via Python-list
Hi, According to the enum module's documentation an Enum-based enumeration's members can have values of any type: "Member values can be anything: int, str, etc.." I defined one with functions as member values. This seemed to work as long as the functions were defined ahead of the enume