(self, attr, val)
| 265 | "attribute '%s'" % attr) |
| 266 | |
| 267 | def __setattr__(self, attr, val): |
| 268 | if attr in ('setfield', 'getfield', 'dtype'): |
| 269 | raise AttributeError("Cannot set '%s' attribute" % attr) |
| 270 | fielddict = nt.void.__getattribute__(self, 'dtype').fields |
| 271 | res = fielddict.get(attr, None) |
| 272 | if res: |
| 273 | return self.setfield(val, *res[:2]) |
| 274 | else: |
| 275 | if getattr(self, attr, None): |
| 276 | return nt.void.__setattr__(self, attr, val) |
| 277 | else: |
| 278 | raise AttributeError("'record' object has no " |
| 279 | "attribute '%s'" % attr) |
| 280 | |
| 281 | def __getitem__(self, indx): |
| 282 | obj = nt.void.__getitem__(self, indx) |
no test coverage detected