On 8/10/07, Eric Smith <[EMAIL PROTECTED]> wrote: > Anyway, if we're keeping conversions, I see two approaches: > > 1: "".format() (or Talin's format_field, actually) understands which > types can be converted to other types, and does the conversions. This > is how Patrick and I wrote the original PEP 3101 sandbox prototype. > > 2: each type's __format__ function understands how to convert to some > subset of all types (int can convert to float and decimal, for example).
I feel I must be missing something obvious here, but could somebody explain the problem with __format__ returning NotImplemented to mean "use a fallback"? It seems like it'd have the advantages of both, ie repr, str, and several other formats are automatic, while it's still possible to override any format or create new ones. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ 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
