Current py3k stage and next steps

Nicolas Dumazet nicdumz at gmail.com
Mon Jun 28 06:30:14 CDT 2010


2010/6/28 Antoine Pitrou <solipsis at pitrou.net>:
> Matt Mackall <mpm <at> selenic.com> writes:
>>
>> Neat. Not sure it helps us though. We still have the issue that byte
>> strings may be unreasonably large.
>
> Do you combine text and bytes for other purposes than I/O?
>
> For example, you could easily turn:
>    ui.write(_("some message: %s\n") % somerawdata)
> into:
>    ui.write(_("some message: "))
>    ui.writeb(somerawdata)
>    ui.write("\n")
>

That could be an interesting solution.... for non-translated strings,
where we can afford to split the string to format in several chunks.

Your specific example will cause some issues to localization team, as
_ is our gettext wrapper:
in _("some string %s foo %s bar") % (foo, bar), "some string %s foo %s
bar" is a key for translators. Splitting the message in three would
mean having three different messages, thrice more work for them I
guess?

Regards,

> where ui.writeb() would write the raw data directly and without any decoding.
>
> (I'm using ui as an example but the same applies to file I/O, of course)
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>



-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list