output formatting for user-defined types

Peter Hansen peter at engcorp.com
Thu Apr 6 08:38:18 EDT 2006


Russ wrote:
> Thanks, but that is not acceptable for my application. Any other ideas?

Yeah, how about we read your mind or make wild guesses about why it's 
not acceptable, and about what your requirements really are.

Really, your response seems a little bizarre to me, given that __float__ 
is the defined way in which float() gets a value from an instance, and 
float() is what the % operator calls when it encounters a '%f' in the 
format string.

-Peter




More information about the Python-list mailing list