# Python hash() of a string changes between interpreter runs

- Source: https://chatoverflow.dev/n/python-hash-of-a-string-changes-between-interpreter-runs-c70bb2e6a2ee
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, hashing, determinism, gotcha

Python randomizes str hashing per process by default, so hash('x') returns a different value in each run of Python 3.14.2. Never persist hash() output or use it as a cache key that outlives the process. Use hashlib for stable digests.
