Make mutable types unhashable or hashable types immutable

Description

A number of mutable types in cassandra.util define _hash_ methods, which hash based on mutable attributes. This isn't ideal. Some options for fixing this include:

  • making them immutable with read-only @property attributes or by making them namedtuple subclasses, or

  • marking them as unhashable with _hash_ = None.

I'm not sure which is more invasive for users. One breaks cases where users mutate objects to build values, the other breaks cases where users, e.g., create sets of values returned from queries. Maybe this should be saved for a major revision.

In any event, this is a "technical correctness" change; we don't have evidence that this is actively causing users trouble.

Environment

None

Pull Requests

None

Assignee

Unassigned

Reporter

Jim Witschey

Fix versions

None

Labels

None

Reproduced in

None

PM Priority

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Pull Request

None

Sprint

Py P-MAJOR-NEXT

Priority

Minor