How much sanity checking is required for function inputs?

Michael Selik michael.selik at gmail.com
Sat Apr 23 21:21:24 EDT 2016


On Sat, Apr 23, 2016 at 9:01 PM Christopher Reimer <
christopher_reimer at icloud.com> wrote:

> On 4/21/2016 9:46 PM, Ethan Furman wrote:
> > Oh! and Enum!!!  ;)
>
> OMG! I totally forgot about Enum. Oh, look. Python supports Enum. Now I
> don't have to roll my own!
>
> Hmm... What do we use Enum for? :)
>

You can use Enum in certain circumstances to replace int or str constants.
It can help avoid mistyping mistakes and might help your IDE give
auto-complete suggestions. I haven't found a good use for them myself, but
I'd been mostly stuck in Python 2 until recently.



More information about the Python-list mailing list