Andrei Kulakov <andrei....@gmail.com> added the comment:

More generally, split()/rsplit() are probably the most common operations done 
on expected string at the start of a function, i.e. most likely to be triggered 
on the wrong type passed in. At the same time to many new users 
split()/rsplit() does not imply anything related to strings, and 'split' sounds 
too generic to expect explanatory results from google search. (although the 
first few results do point to the right explanation, and rsplit does seem like 
something that would return helpful search results).

I wonder if it would be helpful, especially for .split() (and rsplit for 
consistency), to add to the error msg: "... it's likely that a string object 
was expected instead of <type> object".

----------
nosy: +andrei.avk

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

Reply via email to