[Python-ideas] String formatting and namedtuple

Raymond Hettinger python at rcn.com
Wed Feb 11 22:34:48 CET 2009


>> You could then use "re={real} im={imag}".format(GetItemToGetAttrAdaptor(1j+2))
> 
> I'm confused, we can already satisfy this use case:
> 
>>>> "re={0.real} im={0.imag}".format(1j+2)
> 're=2.0 im=1.0'

Interesting how a quest for new tools
blinds us to the ones we already have ;-)


Raymond



More information about the Python-ideas mailing list