<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-07-03 12:29 GMT+02:00 Andrew Barnert <span dir="ltr"><<a href="mailto:abarnert@yahoo.com" target="_blank">abarnert@yahoo.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Jul 2, 2015, at 08:53, Pierre Quentel <<a href="mailto:pierre.quentel@gmail.com">pierre.quentel@gmail.com</a>> wrote:<br>
><br>
> It's true, but testing that an integer is a range is very rare : the pattern "if X in range(Y)" is only found once in all the Python 3.4 standard library<br>
<br>
</span>Given that most of the stdlib predates Python 3.2, and modules are rarely rewritten to take advantage of new features just for the hell of it, this isn't very surprising, or very meaningful.<br></blockquote><div><br>Then most of the stdlib also predates Python 1.5.2 (the version I started with) :<br><br>Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32<br>Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam<br>>>> 4 in range(10)<br>1<br>>>> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Similarly, you'll find that most of the stdlib doesn't use yield from expressions, and many things that could be written in terms of singledispatch instead use type switching, and so on. This doesn't mean yield from or singledispatch are useless or rarely used.</blockquote></div><br></div></div>