Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Vedran, it is not what strong typing means. Strong typing means that '2'+3 is 
an error instead of '23' or 5. str.join() expects an iterable of strings. If 
some of items is not a string, it is a sign of programming error. I prefer to 
get an exception rather of silently conversion of unexpected value to string 
'None', '[]' or '<Foo object at 0x12345678>'.

So if you want such feature, it should be separate method or function.

But there is other consideration. Of 721 uses of the join() method (excluding 
os.path.join()) in the stdlib, only 10 need forceful stringification with 
map(str, ...). For tests it is 842 to 20, and for Doc/venv/ it is 1388 to 30. I 
am sure the same ratio is for any other large volume of code. So that feature 
would actually have very small use - 1-2% of use of str.join().

Specially to Raymond, map(str, ...) is good opportunity to teach about 
iterators and introduce to itertools.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43535>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to