Re: [Python-ideas] Callable Enum values

2017-04-21 Thread Chris Barker
OT, but... You have to use the complete module name? Instead of `from callable_enum > import Enum, Value`? Ouch. yes, but: """ Use from x import y as z if two modules named y are to be imported or if y is an inconveniently long name. """

Re: [Python-ideas] Callable Enum values

2017-04-21 Thread Stephan Hoyer
On Fri, Apr 21, 2017 at 9:43 AM, Ethan Furman wrote: > You have to use the complete module name? Instead of `from callable_enum > import Enum, Value`? Ouch Yeah... it took me a while to come around to this one. But the rule does start to pay off in large code bases.

Re: [Python-ideas] Callable Enum values

2017-04-21 Thread Ethan Furman
On 04/21/2017 09:04 AM, Stephan Hoyer wrote: On Thu, Apr 20, 2017 at 10:58 AM, Ethan Furman wrote: I'm curious, what did you find ugly with: class TestEnum(CallableEnum): @enum def hello(text): "a pleasant greeting" print('hello,', text)

Re: [Python-ideas] Callable Enum values

2017-04-21 Thread Stephan Hoyer
On Thu, Apr 20, 2017 at 10:58 AM, Ethan Furman wrote: > I'm curious, what did you find ugly with: > > class TestEnum(CallableEnum): > > @enum > def hello(text): > "a pleasant greeting" > print('hello,', text) > > @enum