Skip to content

validate TypeIs and TypeGuard definitions #2267

@carljm

Description

@carljm

In order to fully pass the conformance suite for TypeIs and TypeGuard, we need to add some extra validations of functions annotated with a TypeIs or TypeGuard return type.

  1. The function should accept exactly one parameter (not counting self or cls if it's a method / classmethod).
  2. For TypeIs, the type parameter of the TypeIs return type must be assignable to the annotated type of the single parameter.

Metadata

Metadata

Assignees

Labels

conformancehelp wantedContributions especially welcometyping semanticstyping-module features, spec compliance, etc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions