On Wed, Jan 3, 2018 at 8:24 AM, Random832 <random...@fastmail.com> wrote:
> On Sun, Dec 31, 2017, at 00:33, Guido van Rossum wrote: > > I'm not keen on this recommendation. An argument that takes a Set[Foo] > > would mean that in order to specify: > > - no flags: you'd have to pass set() -- you can't use {} since that's an > > empty dict, not an empty set > > Optional[Set[Foo]]? > > > - one flag: you'd have to pass {Foo.BAR} rather than just Foo.BAR > > - two flags: you'd have to pass {Foo.BAR, Foo.BAZ} rather than Foo.BAR | > > Foo.BAZ > > Maybe the flags themselves should be of a type that you can do both with > (i.e. each value is a set containing itself). > That's pretty much what the enum.Flag type does. -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/