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
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