[Python-Dev] transitioning from % to {} formatting (original) (raw)
Vinay Sajip vinay_sajip at yahoo.co.uk
Thu Oct 8 18:51:53 CEST 2009
- Previous message: [Python-Dev] transitioning from % to {} formatting
- Next message: [Python-Dev] transitioning from % to {} formatting
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Benjamin Peterson <benjamin python.org> writes:
It's also really easy to just write 0{:o} like my translator does.
How does that cope when handed a negative number to format?
"%#0o" % -1234 '-02322' "0{0:o}".format(-1234) '0-2322'
Regards,
Vinay Sajip
- Previous message: [Python-Dev] transitioning from % to {} formatting
- Next message: [Python-Dev] transitioning from % to {} formatting
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]