Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-20 Thread אלעזר
On Sat, Aug 20, 2016 at 3:54 PM Michael Selik wrote: > On Fri, Aug 19, 2016 at 8:55 AM Neil Girdhar > wrote: > >> Sure. >> >> http://bugs.python.org/issue27802 >> >> >> On Friday, August 19, 2016 at 8:36:39 AM UTC-4, Emanuel Barry wrote: >>> >>> Arek Bulski wrote: >>> >>> > Could use all(a==b fo

Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-20 Thread Michael Selik
On Fri, Aug 19, 2016 at 8:55 AM Neil Girdhar wrote: > Sure. > > http://bugs.python.org/issue27802 > > > On Friday, August 19, 2016 at 8:36:39 AM UTC-4, Emanuel Barry wrote: >> >> Arek Bulski wrote: >> >> > Could use all(a==b for zip(seq,seq2)) >> >> >> >> Or even `all(itertools.starmap(operator.e

Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-19 Thread Neil Girdhar
Sure. http://bugs.python.org/issue27802 On Friday, August 19, 2016 at 8:36:39 AM UTC-4, Emanuel Barry wrote: > > Arek Bulski wrote: > > > Could use all(a==b for zip(seq,seq2)) > > > > Or even `all(itertools.starmap(operator.eq, zip(a, b)))` if you prefer, > but this isn’t about how easy or cle

Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-19 Thread Neil Girdhar
Right, of course that's better. On Fri, Aug 19, 2016 at 8:01 AM Arek Bulski wrote: > Could use all(a==b for zip(seq,seq2)) > > -- Arkadiusz Bulski -- > ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/pytho

Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-19 Thread Emanuel Barry
Arek Bulski wrote: > Could use all(a==b for zip(seq,seq2)) Or even `all(itertools.starmap(operator.eq, zip(a, b)))` if you prefer, but this isn’t about how easy or clever or obfuscated one can write that; it’s about convenience. ABCs expose the lowest common denominator for concrete classes of

Re: [Python-ideas] Consider having collections.abc.Sequence

2016-08-19 Thread Arek Bulski
Could use all(a==b for zip(seq,seq2)) -- Arkadiusz Bulski -- ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Consider having collections.abc.Sequence implement __eq__ and __ne__

2016-08-19 Thread Neil Girdhar
Both Mapping and Set provide __eq__ and __ne__. I was wondering why not have Sequence do the same? class Sequence(Sized, Reversible, Container): def __eq__(self, other): if not isinstance(other, Sequence): return NotImplemented if len(self) != len(other):

Re: [Python-ideas] Consider having collections.abc.Sequence implement __eq__ and __ne__

2016-08-19 Thread Neil Girdhar
I mean zip(self, other) On Friday, August 19, 2016 at 6:46:57 AM UTC-4, Neil Girdhar wrote: > > Both Mapping and Set provide __eq__ and __ne__. I was wondering why not > have Sequence do the same? > > > class Sequence(Sized, Reversible, Container): > > def __eq__(self, other): > if n