]> git.ipfire.org Git - thirdparty/jinja.git/commit
Use object.__hash__ for Node.__hash__ 1522/head
authorKristian Klette <klette@otovo.com>
Wed, 27 Oct 2021 18:35:20 +0000 (20:35 +0200)
committerDavid Lord <davidism@gmail.com>
Tue, 9 Nov 2021 17:12:22 +0000 (09:12 -0800)
commit9b96b4817a61d7f114de088cfe729a4625c820bc
treed61ad5a25283096f4a133b0028789d8e8070fb01
parentc0130ea7dd138201cf448f6d9a54341deba843ee
Use object.__hash__ for Node.__hash__

This fixes a regression in commit 60293416db69782fd048a7820667afa4ae7c423b that
changed the `__hash__` implementation of Node from the default pointer
hash, to a hash based on the node fields.

Since these fields contains list objects, they are not hashable, making
every call to `Node.__hash__` fail.

This breaks some third-party usage such as in `django-compressor`
(See: https://github.com/django-compressor/django-compressor/issues/1060)

This changed reverts the hash method back to using `object.__hash__` as
the hash implementation.
CHANGES.rst
src/jinja2/nodes.py
tests/test_nodes.py [new file with mode: 0644]