A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-October/010206.html below:

[Python-Dev] getting at the current frame

[Python-Dev] getting at the current frameMartin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat, 28 Oct 2000 12:14:00 +0200
> which actually will look something like this in real code:
>
>    def trade(yours, mine):
>        print _('if you give me %(yours)s, i will give you %(mine)s') % {
>            'yours': yours,
>            'mine' : mine,
>            }
>
> The string wrapped in _() is what gets translated here.
>
> Okay, we all know that's a pain, right?

What's wrong with

    def trade(yours, mine):
        print _('if you give me %(yours)s, i will give you %(mine)s') % vars()

Look Ma, no magic!

Regards,
Martin



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4