[Python-ideas] contextmanager for locale

Mathias Panzenböck grosser.meister.morti at gmx.net
Sun Jan 25 00:53:59 CET 2009


Off topic:

Here would be a with-expression or inline with (like the inline if) handy:

spec_file.write('''
%%changelog

* %s Maintainer Name <maintainer at example.com>
''' % (time.strftime('%a %b %d %Y') with localectx(locale.LC_TIME,('en','UTF8'))))

However, this would be a very long line. Not very clean code.

	-panzi



More information about the Python-ideas mailing list