4 ms·
The format() method is more capable as it plays nice with heterogeneous duck-typed objects. It is type aware and you can supply your own custom formatters throu
by kevin_thibedeau 10y ago
The format() method is more capable as it plays nice with heterogeneous duck-typed objects. It is type aware and you can supply your own custom formatters through __format__ methods that can receive parameters from the format string.
% will spew TypeErrors if you don't get the format specifier right.