[Checkins] [zopefoundation/zope.schema] 68b5f0: ``Field`` instances are hashable on Python 3

GitHub noreply at github.com
Fri Aug 10 23:02:36 CEST 2018


  Branch: refs/heads/issue36
  Home:   https://github.com/zopefoundation/zope.schema
  Commit: 68b5f023436783267bf03f9b034902fa4d422265
      https://github.com/zopefoundation/zope.schema/commit/68b5f023436783267bf03f9b034902fa4d422265
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-08-10 (Fri, 10 Aug 2018)

  Changed paths:
    M CHANGES.rst
    M src/zope/schema/_bootstrapfields.py
    M src/zope/schema/tests/test__bootstrapfields.py

  Log Message:
  -----------
  ``Field`` instances are hashable on Python 3

They use a defined hashing algorithm that matches what equality does
on all versions of Python. Previously, on Python 2, fields were hashed
based on their identity. This violated the rule that equal objects
should have equal hashes, and now they do. Since having equal hashes
does not imply that the objects are equal, this is not expected to be
a compatibility problem.

Included tests with a dict show that there shouldn't be false matches
even with equal hashes.

Fixes #36



      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the checkins mailing list