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

Python type hints: support constrained TypeVars

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage Needed
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: sdk-py-core
    • Labels:

      Description

      Support the following syntax when converting to internal Beam types,
      and raise a TypeCheckError when trying to bind anything that isn't Any, one of the listed types, or a subtype of the listed types.

      AnyStr = TypeVar('AnyStr', Text, bytes)
      

      See: https://www.python.org/dev/peps/pep-0484/#generics (lots of cases to check)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              udim Udi Meiri
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: