Use bytes() on keys to be hashable in Python3 #2243

Open
kashikoibumi wants to merge 1 commits from kashikoibumi/bytes-key into v0.6
kashikoibumi commented 2024-05-26 17:28:32 +02:00 (Migrated from github.com)

This patch is a preparation to migration to Python3.

Use bytes() on keys to be hashable in Python3.
Hash keys used in hashtables must be hashable.
Although it is not problem in Python2, it is a problem in Python3.
When slice or memoryview of mutable byte array is used as hash key in Python3, an exception is raised.
To resolve the problem, this patch convert hash keys to immutable bytes by using bytes() function.

This patch is a preparation to migration to Python3. Use bytes() on keys to be hashable in Python3. Hash keys used in hashtables must be hashable. Although it is not problem in Python2, it is a problem in Python3. When slice or memoryview of mutable byte array is used as hash key in Python3, an exception is raised. To resolve the problem, this patch convert hash keys to immutable bytes by using bytes() function.
This repo is archived. You cannot comment on pull requests.
No description provided.