[Python-Dev] [Python-3000] PEP 30XZ: Simplified Parsing

Barry Warsaw barry at python.org
Wed May 2 21:40:33 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On May 2, 2007, at 2:51 PM, Phillip J. Eby wrote:

> At 10:34 AM 5/2/2007 -0700, Trent Mick wrote:
>> But if you don't want the EOLs? Example from some code of mine:
>>
>>      raise MakeError("extracting '%s' in '%s' did not create the "
>>                      "directory that the Python build will expect: "
>>                      "'%s'" % (src_pkg, dst_dir, dst))
>>
>> I use this kind of thing frequently. Don't know if others consider it
>> bad style.
>
> Well, I do it a lot too; don't know if that makes it good or bad,  
> though.  :)

I just realized that changing these lexical rules might have an  
adverse affect on internationalization.  Or it might force more lines  
to go over the 79 character limit.

The problem is that

	_("some string"
	  " and more of it")

is not the same as

	_("some string" +
	  " and more of it")

because the latter won't be extracted by tools like pygettext (I'm  
not sure about standard gettext).  You would either have to teach  
pygettext and maybe gettext about this construct, or you'd have to  
use something different.  Triple quoted strings are probably not so  
good because you'd have to still backslash the trailing newlines.   
You can't split the strings up into sentence fragments because that  
makes some translations impossible.  Someone ease my worries here.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRjjpOHEjvBPtnXfVAQJ/xwP7BNMGvrmuxKmb7QiIawYjORKt9Pxmz7XJ
kFVHl47UusOGzgmtwm6Qi2DeSDsG0JOu0XwlZbX3YPE8omTzTP8WLdavJ1e+i2nP
V8GwXVyFgyFHx3V1jb0o9eiUGFEwkXInCGcOFqdWOEF49TtRNHGY6ne+eumwkqxK
qOyTGkcreG4=
=J6I/
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list