[IPython-dev] String encoding
Fri Jun 17 12:08:04 CDT 2011
On Fri, Jun 17, 2011 at 3:24 AM, Thomas Kluyver <firstname.lastname@example.org> wrote:
> On 17 June 2011 07:39, Fernando Perez <email@example.com> wrote:
>> I guess we could make it a configurable option, but I'm not even sure
>> it's worth the added complexity, so I'm mildly -1 on going down that
>> road, unless I can be convinced that the implementation isn't that
>> complicated and that there's really a *major* usability win for
>> certain users for whom the default is just too annoying to bear.
> The complexity in terms of code is fairly minimal - a boolean config
> variable, and an if/else inside run_cell should cover it. The main downside
> would be the added load on testing and maintenance - if the variable became
> widely used, any bug report relating to unicode would leave us asking which
> way the user had it set.
> I'll leave it to Jörgen to put the case for usability.
> In fact, I've just worked out a way round the issue, although it's not
> pretty. If we were to encode each cell, and prepend the "# coding: <enc>"
> magic comment before parsing it, it seems to work. However, the line numbers
> within the cell are then out by 1 (i.e. if you see a traceback). As far as I
> can tell, there's no way to store this state between compile/parse calls -
> codeop.Compile doesn't remember it. I don't much like the idea of doing
> this, though.
This sounds too complex. I would say let's just go with (1).
> IPython-dev mailing list
Brian E. Granger
Cal Poly State University, San Luis Obispo
firstname.lastname@example.org and email@example.com
More information about the IPython-dev