[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Accepting a slice directly in the range constructor is ambiguous. What to do if start or stop are negative or None? What if stop is less than start? You need to specify a sequence length to handle these cases. Maybe the following expressions work for you:

[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi
Change by yota moteuchi : -- components: +Interpreter Core -Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi
Change by yota moteuchi : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread yota moteuchi
New submission from yota moteuchi : This improvement proposal is close to : https://bugs.python.org/issue42956 and also detailed in https://stackoverflow.com/questions/13855288/turn-slice-into-range to iterate over a slice, the recommended method seems to be : s = slice(5,100,3) for i in