[issue35200] Make the half-open range behaviour easier to teach

Raymond Hettinger report at bugs.python.org
Mon Nov 19 14:44:45 EST 2018


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

After more thought, I'm in agreement with the comments that the proposed __str__ revision is confusing.

After teaching another Python intro course last week, I'm now thinking that no change should be made.  There are other effective ways to teach half-open intervals (i.e. using slicing on strings is now my preferred way). 

Also students need to learn about using list() with iterators.  This core skill comes up with generators, enumerate, zip, filter, etc. So, we just need to teach the skill earlier in the course than we did with Python2.7.

I recommend that we just close this and resist the urge to create a new oddity that does't generalize well (i.e. most other iterators can't show a preview of the output without actually consuming some of their inputs).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35200>
_______________________________________


More information about the Python-bugs-list mailing list