(self, obj)
| 2101 | raise ValueError("Can only create a chararray from string data.") |
| 2102 | |
| 2103 | def __getitem__(self, obj): |
| 2104 | val = ndarray.__getitem__(self, obj) |
| 2105 | |
| 2106 | if isinstance(val, character): |
| 2107 | temp = val.rstrip() |
| 2108 | if len(temp) == 0: |
| 2109 | val = '' |
| 2110 | else: |
| 2111 | val = temp |
| 2112 | |
| 2113 | return val |
| 2114 | |
| 2115 | # IMPLEMENTATION NOTE: Most of the methods of this class are |
| 2116 | # direct delegations to the free functions in this module. |