Skip to content

Commit fcf5109

Browse files
Apply suggestion from @serhiy-storchaka
1 parent 1521fb1 commit fcf5109

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Include/internal/pycore_object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,9 @@ _PyObject_IS_GC(PyObject *obj)
839839
// Fast inlined version of PyObject_Hash(). Dictionaries are very
840840
// likely to include string keys (class and instance attributes,
841841
// json, ...) so we include a fast path for strings.
842+
// This function should not be used in a collection if str is not
843+
// very likely, since it is slower than PyObject_Hash() on types
844+
// other than str.
842845
static inline Py_ALWAYS_INLINE Py_hash_t
843846
_PyObject_HashDictKey(PyObject *op)
844847
{

0 commit comments

Comments
 (0)