[Numpy-discussion] More loadtxt() changes

Pierre GM pgmdevlist@gmail....
Tue Nov 25 21:17:13 CST 2008

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.

More information about the Numpy-discussion mailing list