James Thiele wrote:
> In the section "Explicit Conversion Flag" of PEP 3101 it says:
> 
> Currently, two explicit conversion flags are recognized:
> 
>         !r - convert the value to a string using repr().
>         !s - convert the value to a string using str().
> --
> It does not say what action is taken if an unrecognized explicit
> conversion flag is found.

My implementation raises a ValueError, which I think is the desired 
behavior:

 >>> "{0!x}".format(1)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ValueError: Unknown converion specifier x

I agree the PEP should be explicit about this.

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to