-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate
is_equivalent_to
unit tests to Markdown tests
- Loading branch information
1 parent
1273aad
commit aae896e
Showing
2 changed files
with
21 additions
and
29 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...s/red_knot_python_semantic/resources/mdtest/type_properties/is_equivalent_to.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Equivalent relation | ||
|
||
```py | ||
from typing import Any | ||
from typing_extensions import Literal | ||
from knot_extensions import Unknown, is_equivalent_to, static_assert | ||
|
||
static_assert(is_equivalent_to(Literal[1, 2], Literal[1, 2])) | ||
static_assert(is_equivalent_to(type[object], type)) | ||
|
||
static_assert(not is_equivalent_to(Any, Any)) | ||
static_assert(not is_equivalent_to(Unknown, Unknown)) | ||
static_assert(not is_equivalent_to(Any, None)) | ||
static_assert(not is_equivalent_to(Literal[1, 2], Literal[1, 0])) | ||
static_assert(not is_equivalent_to(Literal[1, 2], Literal[1, 2, 3])) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters