[Python-Dev] transitioning from % to {} formatting
Vinay Sajip
vinay_sajip at yahoo.co.uk
Thu Oct 8 18:51:53 CEST 2009
More information about the Python-Dev mailing list
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 <at> 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 ]
More information about the Python-Dev mailing list