[IPython-dev] underscore and gettext interaction

Fernando Perez Fernando.Perez at colorado.edu
Fri Jul 2 11:02:33 CDT 2004


Ville Vainio wrote:
> Fernando Perez wrote:
> 
> 
>>Do you mean circumvented by the user?  That's definitely an option, 
>>but I'd like to really fix it in the core.  Especially because they 
>>would have to do
>>
>>l.install();tr=_
>>
>>so that it all happens before ipython has a chance to mangle the _ 
>>variable. Plus, it makes testing of real code fragments which rely on 
>>_ tricky in ipython.  So I think it's worth fixing it for real.
> 
> 
> Apparently normal python interactive interpreter stores "_" in 
> __builtin__, which should achieve what you want...

Thanks for the hint, that put me on the right track.  In fact, ipython is now 
_better_ than standard python in its handling of '_' for interactive work: 
real python eventually clobbers gettext, but only on a second call (because 
gettext also puts '_' in __builtin__).  IPython will detect usage of '_' in 
__builtin__ and stay away always.

It took some playing to get it to work, but it's now in CVS.

I think we're getting ready to cut an RC for 0.6.1 this weekend.  Anyone with 
a remaining issue please say so now.

Best,

f




More information about the IPython-dev mailing list