[Numpy-discussion] ndarray is not a sequence

2014-02-27 Thread Anthony Scopatz
Hello All, The semantics of this seem quite insane to me: In [1]: import numpy as np In [2]: import collections In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]: False In [6]: np.version.full_version Out[6]: '1.9.0.dev-eb40f65' Is there any possibility that ndarray could inherit

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Sturla Molden
Anthony Scopatz wrote: > Hello All, > > The semantics of this seem quite insane to me: > > In [1]: import numpy as np > > In [2]: import collections > > In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]: False > > In [6]: np.version.full_version > Out[6]: '1.9.0.dev-eb40f65' > >

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Sebastian Berg
On Fr, 2014-02-28 at 08:47 +, Sturla Molden wrote: > Anthony Scopatz wrote: > > Hello All, > > > > The semantics of this seem quite insane to me: > > > > In [1]: import numpy as np > > > > In [2]: import collections > > > > In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]: Fal

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Robert Kern
On Fri, Feb 28, 2014 at 9:03 AM, Sebastian Berg wrote: > On Fr, 2014-02-28 at 08:47 +, Sturla Molden wrote: >> Anthony Scopatz wrote: >> > Hello All, >> > >> > The semantics of this seem quite insane to me: >> > >> > In [1]: import numpy as np >> > >> > In [2]: import collections >> > >> > In

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Anthony Scopatz
Thanks All, I am sorry I missed the issue. (I still can't seem to find it, actually.) I agree that there would be minimal overhead here and I bet that would be easy to show. I really look forward to seeing this get in! Be Well Anthony On Fri, Feb 28, 2014 at 4:59 AM, Robert Kern wrote: > O

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Robert Kern
On Fri, Feb 28, 2014 at 3:10 PM, Anthony Scopatz wrote: > Thanks All, > > I am sorry I missed the issue. (I still can't seem to find it, actually.) https://github.com/numpy/numpy/issues/2776 > I agree that there would be minimal overhead here and I bet that would be > easy to show. I really lo

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Chris Barker - NOAA Federal
On Feb 28, 2014, at 1:04 AM, Sebastian Berg wrote: > > because the sequence check like that seems standard in python 3. Whatever happened to duck typing? Sigh. -Chris ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-01 Thread Alexander Belopolsky
On Fri, Feb 28, 2014 at 10:34 AM, Chris Barker - NOAA Federal < chris.bar...@noaa.gov> wrote: > > > Whatever happened to duck typing? > http://legacy.python.org/dev/peps/pep-3119/#abcs-vs-duck-typing ___ NumPy-Discussion mailing list NumPy-Discussion@sci

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-02 Thread Sebastian Berg
On Fr, 2014-02-28 at 09:10 -0600, Anthony Scopatz wrote: > Thanks All, > > > I am sorry I missed the issue. (I still can't seem to find it, > actually.) I agree that there would be minimal overhead here and I > bet that would be easy to show. I really look forward to seeing this > get in! >

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-03 Thread Chris Barker
On Sat, Mar 1, 2014 at 6:09 PM, Alexander Belopolsky wrote: > On Fri, Feb 28, 2014 at 10:34 AM, Chris Barker - NOAA Federal < > chris.bar...@noaa.gov> wrote: > >> >> Whatever happened to duck typing? >> > > http://legacy.python.org/dev/peps/pep-3119/#abcs-vs-duck-typing > Sure -- but I'm afraid t

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-04 Thread Sturla Molden
Chris Barker wrote: > Sure -- but I'm afraid that there will be a lot of code that does an > isinstance() check where it it absolutely unnecessary. If you really need > to know if something is a sequence or a mapping, I suppose it's required, > but how often is that? I must say I don't understan