[issue10021] Format parser is too permissive
Eric Smith <eric@trueblade.com> added the comment: Right. It seemed like a hassle to have the str.format parser try to figure out what a valid identifier is, so it just passes it through. I don't see this as any different from:
class X: ... def __getattribute__(self, a): return 'foo' ... getattr(X(), '$#@') 'foo'
---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10021> _______________________________________
2010/10/4 Eric Smith <report@bugs.python.org>:
Eric Smith <eric@trueblade.com> added the comment:
Right. It seemed like a hassle to have the str.format parser try to figure out what a valid identifier is, so it just passes it through.
You can always use "str.isidentifier()" (I don't remember if there's a capi). -- Regards, Benjamin
participants (2)
-
Benjamin Peterson -
Eric Smith