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/2002-June/025580.html below:

PEP 292, Simpler String Substitutions

[Python-Dev] Re: PEP 292, Simpler String SubstitutionsBarry A. Warsaw barry@wooz.org
Wed, 19 Jun 2002 07:10:10 -0400
>>>>> "KY" == Ka-Ping Yee <ping@zesty.ca> writes:

    KY> I assume you in fact meant

    KY> 	    return '${name} was born in ${country}'.sub()

    KY> for the third line above?

Yup, thanks for the fix.

    >> print s.sub({'name': 'Guido', 'country': 'the Netherlands'})

    KY> Have you considered the possibility of accepting keyword
    KY> arguments instead?

Nope, and it's not a bad idea.  I've added this in an "Open Issues"
section. 
    
    KY> If you decide to use keyword arguments, you can either allow
    KY> both keyword arguments and a single dictionary argument, or
    KY> you can just accept keyword arguments and people can pass in
    KY> dictionaries using **.

I'd prefer the latter, otherwise we'd have to pick a keyword that
would be off-limits as a substitution variable.

Thanks!
-Barry




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