On Sun, 2004-08-22 at 20:47, Raymond Hettinger wrote: > > ... the implementation (patch) I'm going to post > > will require throw the ValueError for all bad placeholders. > > Since you're overriding the mod operator, it may be best to emulate its > behavior which is to throw a KeyError: > > > > >>> '%(bingo)s' % {'bongo':'xxx'} > > Traceback (most recent call last): > File "<pyshell#1>", line 1, in -toplevel- > '%(bingo)s' % {'bongo':'xxx'} > KeyError: 'bingo' That's a different error, and one that Template still throws, if a placeholder can't be found in the mapping. The ValueError is thrown when an invalid placeholder specification is found. -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/20040822/372a6fde/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