Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.
This repository was archived by the owner on May 4, 2021. It is now read-only.

Forward references #17

@attilammagyar

Description

@attilammagyar

How about this?

  Scenario: forward references
    Given that "fwref.py" contains the following code:
          """
          class Myself:
              def equals(self, other: id) -> bool:
                  return other == self

          a = Myself()
          b = Myself()
          a.equals(b)
          a.equals(42)
          """
     When "python3 fwref.py" is run
     Then it must fail:
          """
          typesafety.validator.TypesafetyError: Argument 'other' of function 'equals' is invalid (expected: Myself; got: int)
          """

(Note that there's a different idea for this in PEP0484: https://www.python.org/dev/peps/pep-0484/#forward-references )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions