Re: =+ for strings

2020-05-03 Thread Dan Sommers
On Sun, 3 May 2020 19:38:06 -0700 (PDT) James Smith wrote: > I tried: > dt=+"{:02d}".format(day) > but I got: > dt=+"{:02d}".format(day) > TypeError: bad operand type for unary +: 'str' > > This works: > dt=dt+"{:02d}".format(day) > > Why can't I do the shortcut on strings? ITYM:

Re: =+ for strings

2020-05-03 Thread Chris Angelico
On Mon, May 4, 2020 at 12:41 PM James Smith wrote: > > I tried: > dt=+"{:02d}".format(day) > but I got: > dt=+"{:02d}".format(day) > TypeError: bad operand type for unary +: 'str' > > This works: > dt=dt+"{:02d}".format(day) > > Why can't I do the shortcut on strings? The shortcut is