(self, obj)
| 2005 | raise ValueError("Can only create a chararray from string data.") |
| 2006 | |
| 2007 | def __getitem__(self, obj): |
| 2008 | val = ndarray.__getitem__(self, obj) |
| 2009 | |
| 2010 | if isinstance(val, character): |
| 2011 | temp = val.rstrip() |
| 2012 | if _len(temp) == 0: |
| 2013 | val = '' |
| 2014 | else: |
| 2015 | val = temp |
| 2016 | |
| 2017 | return val |
| 2018 | |
| 2019 | # IMPLEMENTATION NOTE: Most of the methods of this class are |
| 2020 | # direct delegations to the free functions in this module. |