Closed drakeguan closed 9 years ago
Not really an answer to your question, but you can do this intead.
map(str, range(10))
It works only for objects whose __mod__
raises NotImplemented on the right operand
or objects that don't define it at all. In both cases, objects need to have different types.
Perhaps the documentation needs a notice, asking the user to understand what python calls the Data model in order to avoid such pitfalls
For your question, you can always pass a prepared 'format string, eg {0:d}'.format
to map()