New submission from Ram Rachum <[email protected]>:
In the documentation for `itertools.islice` I see this line:
it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1))
Is it really okay to do `s.stop or sys.maxint`? I'm assuming this was targeting
`None`, but what if `s.stop == 0`? And `s.step` could (pathologically) be `0`
too, no?
----------
assignee: docs@python
components: Documentation
messages: 134276
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: Weird `slice.stop or sys.maxint`
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python
3.3, Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11908>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com