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/048126.html below:

[Python-Dev] Re: Update PEP 292

[Python-Dev] Re: Update PEP 292 [Python-Dev] Re: Update PEP 292Barry Warsaw barry at python.org
Fri Aug 20 00:36:42 CEST 2004
On Thu, 2004-08-12 at 02:05, Andrew Durdin wrote:
> One thing the PEP doesn't make clear: do these templates only
> interpolate string variables, or will they handle anything with a
> __str__ method?
> 
> e.g., will the following raise an exception:
> 
> print Template("I am ${height} centimetres tall.") % {height: 183}

In the current implementation, this will raise an exception.  I'm
uncomfortable with automatic stringification (hey, create your own dict
subclass for the mapping if you want ;) -- but I've included this as an
open issue in the next rev of the PEP.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20040819/5ac2e1f7/attachment.pgp
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