Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • M Meta
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 459
    • Issues 459
    • List
    • Boards
    • Service Desk
    • Milestones
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Platform
  • Meta
  • Issues
  • #2473
Closed
Open
Issue created Jul 03, 2020 by vlorentz@vlorentzMaintainer

unbound type variables

KT = TypeVar("KT") VT = TypeVar("VT")

def freeze_optional_dict( d: Union[None, Dict[KT, VT], ImmutableDict[KT, VT]]

^swh/model/model.py:49: error: Type variable "swh.model.model.KT" is unbound

swh/model/model.py:49: note: (Hint: Use "Generic[KT]" or "Protocol[KT]" base class to bind "KT" inside a class)

swh/model/model.py:49: note: (Hint: Use "KT" in function signature to bind "KT" inside a function)

swh/model/model.py:49: error: Type variable "swh.model.model.VT" is unbound

swh/model/model.py:49: note: (Hint: Use "Generic[VT]" or "Protocol[VT]" base class to bind "VT" inside a class)

swh/model/model.py:49: note: (Hint: Use "VT" in function signature to bind "VT" inside a function)

) -> Optional[ImmutableDict[KT, VT]]: if isinstance(d, dict): return ImmutableDict(d) else: return d


Migrated from T2473 (view on Phabricator)

Assignee
Assign to
Time tracking