3 ms·
What disgusts you about it, in particular?
by eliben 13y ago
What disgusts you about it, in particular?
- ekimekim 13y agoThe fact that it allows whitespace-seperated words. It's just wrong. It's weird, unnecessary, it just shouldn't be there. Personally, I would've preferred: >>> Enum('Example', 'foo', 'bar', 'baz') (ie. Enum(name, *values))
- eliben 13y agoThat syntax is a bit unusual, but it has the clear advantage of being far less verbose. Consider this: * The functional API is mostly for short code snippets and experiments in the shell. For real programs, the standard class syntax is preferred and recommended. * namedtuple already uses the same functional API allowing space-separated members, and it's a popular tool in the stdlib. Yes, the first time you run into it it feels a bit odd, but then you get used to it and it's not a big deal.