-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
811decd
commit 6dddbd7
Showing
8 changed files
with
530 additions
and
117 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
# This file doesn't use the standard decomposition. | ||
# Decorator syntax test cases are separated by double # comments. | ||
# Those before the 'output' comment are valid under the old syntax. | ||
# Those after the 'ouput' comment require PEP614 relaxed syntax. | ||
# Do not remove the double # separator before the first test case, it allows | ||
# the comment before the test case to be ignored. | ||
|
||
## | ||
|
||
@decorator | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(arg) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(kwarg=0) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(*args) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(**kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(*args, **kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator(*args, **kwargs,) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(arg) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(kwarg=0) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(*args) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(**kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(*args, **kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@dotted.decorator(*args, **kwargs,) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(arg) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(kwarg=0) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(*args) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(**kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(*args, **kwargs) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@double.dotted.decorator(*args, **kwargs,) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@_(sequence["decorator"]) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@eval("sequence['decorator']") | ||
def f(): | ||
... | ||
|
||
# output | ||
|
||
## | ||
|
||
@decorator()() | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@(decorator) | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@sequence["decorator"] | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@decorator[List[str]] | ||
def f(): | ||
... | ||
|
||
## | ||
|
||
@var := decorator | ||
def f(): | ||
... |
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,37 @@ | ||
#!/usr/bin/env python3.9 | ||
|
||
@relaxed_decorator[0] | ||
def f(): | ||
... | ||
|
||
@relaxed_decorator[extremely_long_name_that_definitely_will_not_fit_on_one_line_of_standard_length] | ||
def f(): | ||
... | ||
|
||
@extremely_long_variable_name_that_doesnt_fit := complex.expression(with_long="arguments_value_that_wont_fit_at_the_end_of_the_line") | ||
def f(): | ||
... | ||
|
||
# output | ||
|
||
|
||
#!/usr/bin/env python3.9 | ||
|
||
|
||
@relaxed_decorator[0] | ||
def f(): | ||
... | ||
|
||
|
||
@relaxed_decorator[ | ||
extremely_long_name_that_definitely_will_not_fit_on_one_line_of_standard_length | ||
] | ||
def f(): | ||
... | ||
|
||
|
||
@extremely_long_variable_name_that_doesnt_fit := complex.expression( | ||
with_long="arguments_value_that_wont_fit_at_the_end_of_the_line" | ||
) | ||
def f(): | ||
... |
Oops, something went wrong.