[Python-ideas] The non-obvious nature of str.join (was Re: sum(...) limitation)

Ethan Furman ethan at stoneleaf.us
Tue Aug 12 17:24:27 CEST 2014


On 08/11/2014 11:29 PM, Stephen J. Turnbull wrote:
> Ethan Furman writes:
>
>   > His remark was pointed at the fact that your output is missing the
>   > final "foo".  Remove the 'r' from __radd__, though, and you would
>   > have what you were trying to demonstrate.
>
> Believe someone when he says he copy-pasted. ;-)  Unless you've
> actually run the code and got a different result, and even then you
> should probably include version information etc.

I did believe -- I just also forgot that Python would use __radd__ in a subclass, and so thought that was a bug.  But 
you're right, I should have tried it myself before posting -- my apologies.

--
~Ethan~


More information about the Python-ideas mailing list