[Sugar-devel] [PATCH] Wireless key dialog: Translate more strings (OLPC#9268)

Sascha Silbe sascha-ml-reply-to-2011-3 at silbe.org
Mon Sep 26 11:52:03 EDT 2011


Excerpts from Daniel Drake's message of 2011-09-14 22:35:43 +0200:
> On Wed, Sep 14, 2011 at 8:01 PM, Chris Leonard <cjlhomeaddress at gmail.com> wrote:
> > tuples (and singleton tuples) are also discussed on the link above.
> 
> Thanks, I don't think this is what Sascha was getting at though. As written:
>   If format requires a single argument, values may be a single non-tuple object.

Just to repeat it on the list: What the patch does is perfectly valid
Python code and will work just fine as long as it gets passed exactly
the argument types it's expecting. However if the argument changes to be
a tuple, Python will choke with the "format % arg" syntax, whereas it
will continue to work with "format % (arg, )". I've hit this problem
quite a lot in my version support branch (because I changed object_id
from a string to a 2-tuple of strings), so I prefer making Sugar more
robust by default (i.e. as a matter of style). In addition it looks more
consistent to my eye to always use "format % (tuple contents,...)"
rather than using "format % arg" in some of the cases.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110926/3b34f698/attachment.pgp>


More information about the Sugar-devel mailing list