[Python-Dev] Re: Update PEP 292 (original) (raw)
Raymond Hettinger python at rcn.com
Mon Aug 23 02:47:14 CEST 2004
- Previous message: [Python-Dev] Re: Update PEP 292
- Next message: [Python-Dev] Re: Update PEP 292
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
... 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'
Raymond
- Previous message: [Python-Dev] Re: Update PEP 292
- Next message: [Python-Dev] Re: Update PEP 292
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]