[Numpy-discussion] More loadtxt() changes

Ryan May rmay31 at gmail.com
Tue Nov 25 22:23:54 EST 2008


Pierre GM wrote:
> On Nov 25, 2008, at 10:02 PM, Ryan May wrote:
>> Pierre GM wrote:
>>> * Your locked version of update won't probably work either, as you  
>>> force
>>> the converter to output a string (you set the status to largest
>>> possible, that's the one that outputs strings). Why don't you set the
>>> status to the current one (make a tmp one if needed).
>> Looking at the code, it looks like mapper is only used in the  
>> upgrade()
>> method. My goal by setting status to the largest possible is to lock  
>> the
>> converter to the supplied function.  That way for the user supplied
>> converters, the StringConverter doesn't try to upgrade away from  
>> it.  My
>> thinking was that if the user supplied converter function fails, the
>> user should know. (Though I got this wrong the first time.)
>>
> 
> Then, define a _locked attribute in StringConverter, and prevent  
> upgrade to run if self._locked is True.

Sure if you're into logic and sound design.  I was going more for 
hackish and obtuse.

(No seriously, I don't know why I didn't think of that.)

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma



More information about the NumPy-Discussion mailing list