Re: [Python-ideas] str(slice(10)) should return "slice(10)"

2016-11-13 Thread Ivan Levkivskyi
On 13 November 2016 at 04:07, Guido van Rossum wrote: > > On Sat, Nov 12, 2016 at 5:46 PM, David Mertz wrote: > >> If we *do* want the name 'slice' as the spelling for the thing that can >> either be called or indexed to create a slice object, we could probably use >> some boilerplate like this:

Re: [Python-ideas] str(slice(10)) should return "slice(10)"

2016-11-13 Thread Guido van Rossum
Sounds good. On Sun, Nov 13, 2016 at 3:25 AM, Ivan Levkivskyi wrote: > On 13 November 2016 at 04:07, Guido van Rossum wrote: > >> >> On Sat, Nov 12, 2016 at 5:46 PM, David Mertz wrote: >> >>> If we *do* want the name 'slice' as the spelling for the thing that can >>> either be called or indexe

Re: [Python-ideas] str(slice(10)) should return "slice(10)"

2016-11-13 Thread Guido van Rossum
On Sat, Nov 12, 2016 at 7:35 PM, Alexander Heger wrote: > > But let's make str() of a slice more suggestive of actual slicing, and >> as a bonus, make slices easier to create too. >> >> str(slice(None, None, None)) => "slice[:]" >> > > following all the later discussion, I'd like to come back

Re: [Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

2016-11-13 Thread Mikhail V
On 12 November 2016 at 21:08, João Matos wrote: > What I would like to propose is the creation of the reverse: > a =+ c is the same as a = c + a > a =- c is the same as a = c - a > a =* c is the same as a = c * a > a =/ c is the same as a = c / a > a =// c is the same as a = c // a > a =% c is th

Re: [Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

2016-11-13 Thread Todd
On Sun, Nov 13, 2016 at 4:00 PM, Mikhail V wrote: > On 12 November 2016 at 21:08, João Matos wrote: > > > What I would like to propose is the creation of the reverse: > > a =+ c is the same as a = c + a > > a =- c is the same as a = c - a > > a =* c is the same as a = c * a > > a =/ c is the sam

Re: [Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

2016-11-13 Thread Mikhail V
On 14 November 2016 at 00:08, Todd wrote: > > On Sun, Nov 13, 2016 at 4:00 PM, Mikhail V wrote: >> >> On 12 November 2016 at 21:08, João Matos wrote: >> >> > What I would like to propose is the creation of the reverse: >> > a =+ c is the same as a = c + a >> > a =- c is the same as a = c - a >>

Re: [Python-ideas] Reduce/fold and scan with generator expressions and comprehensions

2016-11-13 Thread Danilo J. S. Bellini
2016-11-06 23:27 GMT-02:00 Wes Turner : > - So, IIUC, for recursive list comprehensions > - "prev" = x_(n-1) > - there is a need to define an initial value > - chain([1000], [...]) > - sometimes, we actually need window function > - __[0] = x_(n-1) > - __[1] = x_(n-2) # this >

Re: [Python-ideas] Reduce/fold and scan with generator expressions and comprehensions

2016-11-13 Thread Wes Turner
I think I understand now. Still, for the more general case, I think it could be useful to be able to specify a max window size for the the dequeue (or indexable list-like structure); though defaulting to None and storing all values may be additionally useful. On Monday, November 14, 2016, Danilo J