Eric V. Smith added the comment:

I think this change should not be made: it's a slippery slope, because there 
are thousands of places in the stdlib where a similar change could be made.

It's the nature of duck typing that you're not going to get a great error 
message everywhere you pass in the wrong type. Python programmers just have to 
learn this and understand it's a source of sometimes unobvious error messages.

If, despite my concerns, this change is still made, I think it is important 
that any new error message not mention "str", or any list of accepted types. 
The proposal in msg181762 is good enough: just say that whatever type was used 
isn't acceptable. For example: there are a number of "path object" proposals 
floating around, and it's possible one of those could be used with os.path.join 
despite it not being a str.

----------
nosy: +eric.smith

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

Reply via email to