-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for @no_type_check decorator. This addresses #1448. (#6…
…987)
- Loading branch information
Showing
5 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
28 changes: 28 additions & 0 deletions
28
packages/pyright-internal/src/tests/samples/noTypeCheck1.py
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,28 @@ | ||
# This sample tests the handling of the @no_type_check decorator. | ||
|
||
|
||
from typing import no_type_check | ||
|
||
|
||
@no_type_check | ||
class A: | ||
# This should generate an error because no_type_check has | ||
# no effect when applied to a class. | ||
x: int = "" | ||
|
||
|
||
@no_type_check | ||
def func1(a: int, b: int(), *args, c: int = 3) -> dummy: | ||
x: int = "" | ||
|
||
|
||
reveal_type( | ||
func1, | ||
expected_text="(a: Unknown, b: Unknown, *args: Unknown, c: Unknown = 3) -> Unknown", | ||
) | ||
|
||
|
||
# This should generate an error. | ||
func1() | ||
|
||
func1("", "", c="") |
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