
On 24Dec2022 15:12, Chris Angelico <rosuav@gmail.com> wrote:
On Sat, 24 Dec 2022 at 15:00, Cameron Simpson <cs@cskk.id.au> wrote:
help(list.index) seems empty.
Huh that's strange. I'm checking this in a few recent versions, and they all say "Return first index of value".
Ugh. It isn't empty. But on my local system the pager help() invokes seems to use the alternate screen, so when I exit it the help's gone. I really need to debug that, it's incredibly annoying.
3) If your answer to question 1 was incorrect, {does it help, would it have helped} to have a note in the docs?
It would help to be able to understand the behaviour. I think with `list.index` I'd expect an equality test only (I was surprised by your "nan" example, even though "nan" is a pretty unusual value).
It might help in those rare instances where you think to go and read the docs, which basically means the times when something looks wrong to you.
Often.
It almost certainly won't help for cases where someone doesn't recognize a problem. With string uppercasing, anyone who would think to look in the docs for how it handles locale-specific case conversions is already going to understand that it can't possibly do anything more than a generic translation table, so I don't think it'd buy anything to have a note in the docs.
I'm not so sure. For example, my naive inclination with maybe have been to look to see if it paid attention to say the POSIX locale, and blithely assume that such attention might be enough. Though I wonder if acting differently for locales might amount to mojibake sometimes. Cheers, Cameron Simpson <cs@cskk.id.au>