[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread xitop
xitop added the comment: You are right. It is 'key in d', not 'object in d'. (Thanks for you patience. I'm sorry I did not get it right earlier.) -- ___ Python tracker

[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread INADA Naoki
INADA Naoki added the comment: We have it already: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict > A dictionary’s keys are almost arbitrary values. Values that are not > hashable, that is, values containing lists, dictionaries or other mutable >

[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread xitop
xitop added the comment: While I do fully agree with not documenting all exceptions, I'd like to point out a major difference in the case of "unhashable in dict". It differs from the general case where an exception means the function is unable to return a meaningful

[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: In general, Python functions don't document all possible exceptions. One reason is that it would lead to substantial redundancy in the docs. Another reason is that functions generally don't know all the possible exceptions

[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread xitop
New submission from xitop : I'd like to suggest an addition to the documentation of the "key in dict" operation. Current version found at https://docs.python.org/3/library/stdtypes.html#dict says only: --- key in d Return True if d has a key key, else False. --- This

[issue32899] Not documented: key in dict test may raise TypeError

2018-02-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +inada.naoki, rhettinger ___ Python tracker ___