Issue 24274: erroneous comments in dictobject.c (original) (raw)

https://hg.python.org/cpython/file/2df7c958974e/Objects/dictobject.c#l451

The comments near lookdict suggest that specialized versions such as lookdict_unicode and lookdict_unicode_nodummy cannot return NULL, as that would indicate an Exception was raised during comparison.

They can return NULL, because if the search key is not unicode, they replace themselves with the generic lookdict and then return its result, which may be NULL.

Comments have been updated by the new dict implementation in 3.6+, but the 3.5 branch still needs to be updated.