Commits

Maciej Fijalkowski  committed 4782257

get/set item for scalars

  • Participants
  • Parent commits 8aa0985
  • Branches numpy-refactor

Comments (0)

Files changed (1)

File pypy/module/micronumpy/arrayimpl/scalar.py

 
 from pypy.module.micronumpy.arrayimpl import base
+from pypy.interpreter.error import OperationError
 
 class ScalarIterator(base.BaseArrayIterator):
     def __init__(self, v):
 
     def transpose(self):
         return self
+
+    def descr_getitem(self, space, w_idx):
+        raise OperationError(space.w_IndexError,
+                             space.wrap("scalars cannot be indexed"))
+
+    def descr_setitem(self, space, w_idx, w_val):
+        raise OperationError(space.w_IndexError,
+                             space.wrap("scalars cannot be indexed"))
+