Coercing str.join() argument elements to str

I just saw someone mention this on Twitter, and I know that I've been bitten by it before. Seems like it wouldn't break any existing code... The worst that could happen is that someone gets nonsensical strings in new code instead of an exception.
Has this been discussed before? If not, what would be reasons not to do this? Cheers, Dirkjan


Dirkjan Ochtman wrote:
"I find it amusing when novice programmers believe their main job is preventing programs from crashing. ... More experienced programmers realize that correct code is great, code that crashes could use improvement, but incorrect code that doesn’t crash is a horrible nightmare." -- Chris Smith http://cdsmith.wordpress.com/2011/01/09/an-old-article-i-wrote/ -- Steven


Dirkjan Ochtman wrote:
"I find it amusing when novice programmers believe their main job is preventing programs from crashing. ... More experienced programmers realize that correct code is great, code that crashes could use improvement, but incorrect code that doesn’t crash is a horrible nightmare." -- Chris Smith http://cdsmith.wordpress.com/2011/01/09/an-old-article-i-wrote/ -- Steven
participants (5)
-
Dirkjan Ochtman
-
Guido van Rossum
-
Laurens Van Houtven
-
Nick Coghlan
-
Steven D'Aprano