Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-3730

typehints.TypeVariable issues with __hash__

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • None
    • None
    • sdk-py-core
    • None

    Description

      This class currently does not define a _hash_ function. This defies the assumption made by sets and dicts which contain TypeConstraint objects.

      In Python 3, classes which define __eq__ also need to explicitly define __hash__ to be hashable. However, this causes combiners_test.CombineTest.test_to_list_and_to_dict to throw an error in slow_stream.py (adding NoneType and long).

      There are multiple TypeVariable instances with name 'K' or 'V' throughout the codebase. The equality of these instances may possibly cause issues.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              luke-zhu Luke Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: