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/2004-August/048240.html below:

[Python-Dev] Re: PEP 292 - Simpler String Substitutions

[Python-Dev] Re: PEP 292 - Simpler String Substitutions [Python-Dev] Re: PEP 292 - Simpler String SubstitutionsMichael Chermside mcherm at mcherm.com
Mon Aug 23 17:54:46 CEST 2004
François Pinard writes:
> [quotations from the PEP motivation] let me think that people will often
> forget to stringify numbers and various other value types,

I agree. I'd like to raise a small voice in favor of automatically
calling str() on all arguments before interpolation. I'd rather
type this:

    # ... code ...
    out.write( template("$foo\t$bar\t$baz\n") % locals() )

than this:

    # ... code ...
    out.write( template("$foo\t$bar\t$baz\n") %
        {'foo': str(foo), 'bar': str(bar), 'baz': str(baz)} )

-- Michael Chermside

More information about the Python-Dev mailing list

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