Skip to content

numeric ops with None should work (and return an option type for that arr) #367

Open

Description

@jreback
In [1]: arr = nd.array([1,2,3])

In [2]: arr + np.nan
Out[2]: 
nd.array([nan, nan, nan],
         type="3 * float64")

In [3]: arr + None  
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-3-2cfd5307e6f3> in <module>()
----> 1 arr + None

dynd/nd/array.pyx in dynd.nd.array.array.__add__ (/Users/travis/build/libdynd/dynd-python/build/temp.macosx-10.5-x86_64-2.7/array.cxx:3331)()

dynd/nd/array.pyx in dynd.nd.array.asarray (/Users/travis/build/libdynd/dynd-python/build/temp.macosx-10.5-x86_64-2.7/array.cxx:5067)()

RuntimeError: could not convert python object of type <type 'NoneType'> into a dynd array

Activity

  1. mwiebe commented on Sep 21, 2015

    @mwiebe
    Member

    I guess we would make None into a scalar of type ?void?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions