<div dir="ltr">Hmm, yea I had not thought of how it would look - I had thought formost of not needing to necessarily learn about bitsets.when learning about passing a large number of optional flags to a function.<br><br>Although the default could be None, interpreted as an empty set of zero values.; a set of one or more enums does use more characters compared to or-ing flags...<br><br>On Sunday, 31 December 2017 05:34:23 UTC, Guido van Rossum  wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div><div class="gmail_quote">On Sat, Dec 30, 2017 at 8:50 PM, Franklin? Lee <span dir="ltr"><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wv6RrCVCBgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">leewangzh...@gmail.com</a><wbr>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Paddy might want something like this:<br>
- For existing APIs which take int or IntFlag flags, allow them to<br>
also take a set (or perhaps any collection) of flags.<br>
- In new APIs, take sets of Enum flags, and don't make them IntFlag.<br>
- Documentation should show preference toward using sets of Enum<br>
flags. Tutorials should pass sets.</blockquote></div><div><br></div>I'm not keen on this recommendation. An argument that takes a Set[Foo] would mean that in order to specify:</div><div>- no flags: you'd have to pass set() -- you can't use {} since that's an empty dict, not an empty set</div><div>- one flag: you'd have to pass {Foo.BAR} rather than just Foo.BAR</div><div>- two flags: you'd have to pass {Foo.BAR, Foo.BAZ} rather than Foo.BAR | Foo.BAZ</div><div><br></div><div>I think for each of these the proposal would be strictly worse than the current convention.<br clear="all"><div><br></div>-- <br><div>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fpython.org%2F~guido\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKI5lSgzXFUM7Y5HtkFAp6sQAxEg';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fpython.org%2F~guido\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGKI5lSgzXFUM7Y5HtkFAp6sQAxEg';return true;">python.org/~guido</a>)</div>
</div></div>
</blockquote></div>