Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes: > Is it silly to create an enumeration with only a single member?
No. > That is, a singleton enum? Why stop there? You can make empty ones too. (Zerotons?) > The reason I ask is that I have two functions that take an enum > argument. Sounds like a good reason. > def spam(arg): > if isinstance(arg, MarxBros): > def ham(arg): > if isinstance(arg, MarxBros) or arg is Unique.FOO: > Good, bad or indifferent? Ummmm, that's ugly, but the alternatives are worse unless there's more branches, and maybe even then. -- https://mail.python.org/mailman/listinfo/python-list