Eric Smith wrote:
> Ron Adam wrote:
>> I wonder if this is splitting things up a bit too finely?  If the format 
>> function takes a conversion argument, it makes it possible to do 
>> everything by overriding format_field.
>>
>>     def format_field(self, value, format_spec, conversion):
>>         return format(value, format_spec, conversion)
>>
>>
>> Adding this to Talins suggestion, the signature of format could be...
>>
>>     format(value, format_spec="", conversion="")
> 
> But this conflates conversions with formatting, which the PEP takes 
> pains not to do.  I'd rather leave them separate, but I'll let Talin 
> make the call.

Correct. There's no reason for 'format' to handle conversions, when its 
trivial for a caller to do it themselves:

   format(repr(value), format_spec)

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