[Python-ideas] Re: Creating ranges with ellipsis

2022-02-18 Thread Vishesh Mangla
[:y] would just mean [0:y]. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org

[Python-ideas] Re: Creating ranges with ellipsis

2022-02-16 Thread Nick Timkovich
> > > This might be a silly idea but, would it be a good idea to have > > ...[a:b:c] return a range(a, b, c)? > If a 'thunderscore' is acceptable: import itertools class _ranger: @classmethod def __getitem__(self, key: slice): if isinstance(key, slice): if key.stop is

[Python-ideas] Re: Creating ranges with ellipsis

2022-02-16 Thread David Lowry-Duda
> This might be a silly idea but, would it be a good idea to have > ...[a:b:c] return a range(a, b, c)? This sort of highly-subjective syntactic sugar makes me wonder whether there would be support for a standard python preprocessor, like what was suggested in PEP 638 [1]. [1]: https://www.pyth

[Python-ideas] Re: Creating ranges with ellipsis

2022-02-16 Thread Serhiy Storchaka
16.02.22 14:44, Soni L. пише: > This might be a silly idea but, would it be a good idea to have > ...[a:b:c] return a range(a, b, c)? See PEP 204. https://www.python.org/dev/peps/pep-0204/ ___ Python-ideas mailing list -- python-ideas@python.org To uns

[Python-ideas] Re: Creating ranges with ellipsis

2022-02-16 Thread Soni L.
On 2022-02-16 10:45, Steven D'Aprano wrote: > On Wed, Feb 16, 2022 at 09:44:07AM -0300, Soni L. wrote: > > This might be a silly idea but, would it be a good idea to have > > ...[a:b:c] return a range(a, b, c)? > > Similar ideas have been suggested before: > > https://mail.python.org/archives/li

[Python-ideas] Re: Creating ranges with ellipsis

2022-02-16 Thread Steven D'Aprano
On Wed, Feb 16, 2022 at 09:44:07AM -0300, Soni L. wrote: > This might be a silly idea but, would it be a good idea to have > ...[a:b:c] return a range(a, b, c)? Similar ideas have been suggested before: https://mail.python.org/archives/list/python-ideas@python.org/thread/W44PPBJJXETTBQHWCMJB3DRCD