mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-23 13:05:06 +00:00
Add formatting for MatchCase
(#6360)
## Summary This PR adds formatting support for `MatchCase` node with subs for the `Pattern` nodes. ## Test Plan Added test cases for case node handling with comments, newlines. resolves: #6299
This commit is contained in:
parent
8b24238d19
commit
c434bdd2bd
10 changed files with 256 additions and 29 deletions
|
@ -55,3 +55,56 @@ def foo():
|
||||||
match inside_func: # comment
|
match inside_func: # comment
|
||||||
case "bar":
|
case "bar":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match newlines:
|
||||||
|
|
||||||
|
# case 1 leading comment
|
||||||
|
|
||||||
|
|
||||||
|
case "top level case comment with newlines": # case dangling comment
|
||||||
|
# pass leading comment
|
||||||
|
pass
|
||||||
|
# pass trailing comment
|
||||||
|
|
||||||
|
|
||||||
|
# case 2 leading comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case "case comment with newlines" if foo == 2: # second
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "one", "newline" if (foo := 1): # third
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
case "two newlines":
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case "three newlines":
|
||||||
|
pass
|
||||||
|
case _:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match long_lines:
|
||||||
|
case "this is a long line for if condition" if aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2: # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "this is a long line for if condition with parentheses" if (aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2): # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "named expressions aren't special" if foo := 1:
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "named expressions aren't that special" if (foo := 1):
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "but with already broken long lines" if (
|
||||||
|
aaaaaaahhhhhhhhhhh == 1 and
|
||||||
|
bbbbbbbbaaaaaahhhh == 2
|
||||||
|
): # another comment
|
||||||
|
pass
|
||||||
|
|
|
@ -213,6 +213,7 @@ fn is_first_statement_in_body(statement: AnyNodeRef, has_body: AnyNodeRef) -> bo
|
||||||
| AnyNodeRef::ExceptHandlerExceptHandler(ast::ExceptHandlerExceptHandler {
|
| AnyNodeRef::ExceptHandlerExceptHandler(ast::ExceptHandlerExceptHandler {
|
||||||
body, ..
|
body, ..
|
||||||
})
|
})
|
||||||
|
| AnyNodeRef::MatchCase(ast::MatchCase { body, .. })
|
||||||
| AnyNodeRef::StmtFunctionDef(ast::StmtFunctionDef { body, .. })
|
| AnyNodeRef::StmtFunctionDef(ast::StmtFunctionDef { body, .. })
|
||||||
| AnyNodeRef::StmtClassDef(ast::StmtClassDef { body, .. }) => {
|
| AnyNodeRef::StmtClassDef(ast::StmtClassDef { body, .. }) => {
|
||||||
are_same_optional(statement, body.first())
|
are_same_optional(statement, body.first())
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use ruff_formatter::{write, Buffer, FormatResult};
|
use ruff_formatter::{write, Buffer, FormatResult};
|
||||||
use ruff_python_ast::MatchCase;
|
use ruff_python_ast::MatchCase;
|
||||||
|
|
||||||
use crate::expression::maybe_parenthesize_expression;
|
use crate::comments::trailing_comments;
|
||||||
use crate::expression::parentheses::Parenthesize;
|
|
||||||
use crate::not_yet_implemented_custom_text;
|
use crate::not_yet_implemented_custom_text;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::{FormatNodeRule, PyFormatter};
|
use crate::{FormatNodeRule, PyFormatter};
|
||||||
|
@ -19,6 +18,9 @@ impl FormatNodeRule<MatchCase> for FormatMatchCase {
|
||||||
body,
|
body,
|
||||||
} = item;
|
} = item;
|
||||||
|
|
||||||
|
let comments = f.context().comments().clone();
|
||||||
|
let dangling_item_comments = comments.dangling_comments(item);
|
||||||
|
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
[
|
[
|
||||||
|
@ -39,17 +41,21 @@ impl FormatNodeRule<MatchCase> for FormatMatchCase {
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if let Some(guard) = guard {
|
if let Some(guard) = guard {
|
||||||
write!(
|
write!(f, [space(), text("if"), space(), guard.format()])?;
|
||||||
f,
|
|
||||||
[
|
|
||||||
space(),
|
|
||||||
text("if"),
|
|
||||||
space(),
|
|
||||||
maybe_parenthesize_expression(guard, item, Parenthesize::IfBreaks)
|
|
||||||
]
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, [text(":"), block_indent(&body.format())])
|
write!(
|
||||||
|
f,
|
||||||
|
[
|
||||||
|
text(":"),
|
||||||
|
trailing_comments(dangling_item_comments),
|
||||||
|
block_indent(&body.format())
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fmt_dangling_comments(&self, _node: &MatchCase, _f: &mut PyFormatter) -> FormatResult<()> {
|
||||||
|
// Handled as part of `fmt_fields`
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
use ruff_formatter::{FormatOwnedWithRule, FormatRefWithRule};
|
||||||
|
use ruff_python_ast::Pattern;
|
||||||
|
|
||||||
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub(crate) mod pattern_match_as;
|
pub(crate) mod pattern_match_as;
|
||||||
pub(crate) mod pattern_match_class;
|
pub(crate) mod pattern_match_class;
|
||||||
pub(crate) mod pattern_match_mapping;
|
pub(crate) mod pattern_match_mapping;
|
||||||
|
@ -6,3 +11,37 @@ pub(crate) mod pattern_match_sequence;
|
||||||
pub(crate) mod pattern_match_singleton;
|
pub(crate) mod pattern_match_singleton;
|
||||||
pub(crate) mod pattern_match_star;
|
pub(crate) mod pattern_match_star;
|
||||||
pub(crate) mod pattern_match_value;
|
pub(crate) mod pattern_match_value;
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
pub struct FormatPattern;
|
||||||
|
|
||||||
|
impl FormatRule<Pattern, PyFormatContext<'_>> for FormatPattern {
|
||||||
|
fn fmt(&self, item: &Pattern, f: &mut PyFormatter) -> FormatResult<()> {
|
||||||
|
match item {
|
||||||
|
Pattern::MatchValue(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchSingleton(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchSequence(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchMapping(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchClass(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchStar(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchAs(p) => p.format().fmt(f),
|
||||||
|
Pattern::MatchOr(p) => p.format().fmt(f),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ast> AsFormat<PyFormatContext<'ast>> for Pattern {
|
||||||
|
type Format<'a> = FormatRefWithRule<'a, Pattern, FormatPattern, PyFormatContext<'ast>>;
|
||||||
|
|
||||||
|
fn format(&self) -> Self::Format<'_> {
|
||||||
|
FormatRefWithRule::new(self, FormatPattern)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ast> IntoFormat<PyFormatContext<'ast>> for Pattern {
|
||||||
|
type Format = FormatOwnedWithRule<Pattern, FormatPattern, PyFormatContext<'ast>>;
|
||||||
|
|
||||||
|
fn into_format(self) -> Self::Format {
|
||||||
|
FormatOwnedWithRule::new(self, FormatPattern)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use ruff_formatter::{write, Buffer, FormatResult};
|
use ruff_formatter::{format_args, write, Buffer, FormatResult};
|
||||||
use ruff_python_ast::StmtMatch;
|
use ruff_python_ast::StmtMatch;
|
||||||
|
|
||||||
use crate::comments::trailing_comments;
|
use crate::comments::{leading_alternate_branch_comments, trailing_comments};
|
||||||
|
use crate::context::{NodeLevel, WithNodeLevel};
|
||||||
use crate::expression::maybe_parenthesize_expression;
|
use crate::expression::maybe_parenthesize_expression;
|
||||||
use crate::expression::parentheses::Parenthesize;
|
use crate::expression::parentheses::Parenthesize;
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -35,8 +36,29 @@ impl FormatNodeRule<StmtMatch> for FormatStmtMatch {
|
||||||
]
|
]
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
for case in cases {
|
let mut cases_iter = cases.iter();
|
||||||
write!(f, [block_indent(&case.format())])?;
|
let Some(first) = cases_iter.next() else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
// The new level is for the `case` nodes.
|
||||||
|
let mut f = WithNodeLevel::new(NodeLevel::CompoundStatement, f);
|
||||||
|
|
||||||
|
write!(f, [block_indent(&first.format())])?;
|
||||||
|
let mut last_case = first;
|
||||||
|
|
||||||
|
for case in cases_iter {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
[block_indent(&format_args!(
|
||||||
|
&leading_alternate_branch_comments(
|
||||||
|
comments.leading_comments(case),
|
||||||
|
last_case.body.last(),
|
||||||
|
),
|
||||||
|
&case.format()
|
||||||
|
))]
|
||||||
|
)?;
|
||||||
|
last_case = case;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -265,7 +265,7 @@ match x:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
y = 0
|
y = 0
|
||||||
- case [1, 0] if (x := x[:0]):
|
- case [1, 0] if (x := x[:0]):
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern if x := x[:0]:
|
+ case NOT_YET_IMPLEMENTED_Pattern if (x := x[:0]):
|
||||||
y = 1
|
y = 1
|
||||||
- case [1, 0]:
|
- case [1, 0]:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
|
@ -431,7 +431,7 @@ match (0, 1, 2):
|
||||||
match x:
|
match x:
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
y = 0
|
y = 0
|
||||||
case NOT_YET_IMPLEMENTED_Pattern if x := x[:0]:
|
case NOT_YET_IMPLEMENTED_Pattern if (x := x[:0]):
|
||||||
y = 1
|
y = 1
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
y = 2
|
y = 2
|
||||||
|
|
|
@ -205,7 +205,7 @@ match bar1:
|
||||||
assert "map" == b
|
assert "map" == b
|
||||||
|
|
||||||
|
|
||||||
@@ -59,61 +62,47 @@
|
@@ -59,61 +62,51 @@
|
||||||
),
|
),
|
||||||
case,
|
case,
|
||||||
):
|
):
|
||||||
|
@ -217,11 +217,11 @@ match bar1:
|
||||||
- ):
|
- ):
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
-
|
|
||||||
- case [a as match]:
|
- case [a as match]:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
-
|
|
||||||
- case case:
|
- case case:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
@ -255,11 +255,11 @@ match bar1:
|
||||||
- case 1 as a:
|
- case 1 as a:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
-
|
|
||||||
- case 2 as b, 3 as c:
|
- case 2 as b, 3 as c:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
-
|
|
||||||
- case 4 as d, (5 as e), (6 | 7 as g), *h:
|
- case 4 as d, (5 as e), (6 | 7 as g), *h:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
@ -351,8 +351,10 @@ match match(
|
||||||
):
|
):
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -377,8 +379,10 @@ match something:
|
||||||
match something:
|
match something:
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ def where_is(point):
|
||||||
|
|
||||||
match event.get():
|
match event.get():
|
||||||
- case Click((x, y), button=Button.LEFT): # This is a left click
|
- case Click((x, y), button=Button.LEFT): # This is a left click
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern: # This is a left click
|
||||||
handle_click_at(x, y)
|
handle_click_at(x, y)
|
||||||
- case Click():
|
- case Click():
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
|
@ -306,7 +306,7 @@ match event.get():
|
||||||
raise ValueError(f"Unrecognized event: {other_event}")
|
raise ValueError(f"Unrecognized event: {other_event}")
|
||||||
|
|
||||||
match event.get():
|
match event.get():
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern: # This is a left click
|
||||||
handle_click_at(x, y)
|
handle_click_at(x, y)
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass # ignore other clicks
|
pass # ignore other clicks
|
||||||
|
|
|
@ -31,21 +31,21 @@ def http_status(status):
|
||||||
```diff
|
```diff
|
||||||
--- Black
|
--- Black
|
||||||
+++ Ruff
|
+++ Ruff
|
||||||
@@ -1,13 +1,10 @@
|
@@ -1,13 +1,13 @@
|
||||||
def http_status(status):
|
def http_status(status):
|
||||||
match status:
|
match status:
|
||||||
- case 400:
|
- case 400:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Bad request"
|
return "Bad request"
|
||||||
-
|
|
||||||
- case 401:
|
- case 401:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Unauthorized"
|
return "Unauthorized"
|
||||||
-
|
|
||||||
- case 403:
|
- case 403:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Forbidden"
|
return "Forbidden"
|
||||||
-
|
|
||||||
- case 404:
|
- case 404:
|
||||||
+ case NOT_YET_IMPLEMENTED_Pattern:
|
+ case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Not found"
|
return "Not found"
|
||||||
|
@ -58,10 +58,13 @@ def http_status(status):
|
||||||
match status:
|
match status:
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Bad request"
|
return "Bad request"
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Unauthorized"
|
return "Unauthorized"
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Forbidden"
|
return "Forbidden"
|
||||||
|
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
return "Not found"
|
return "Not found"
|
||||||
```
|
```
|
||||||
|
|
|
@ -61,6 +61,59 @@ def foo():
|
||||||
match inside_func: # comment
|
match inside_func: # comment
|
||||||
case "bar":
|
case "bar":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match newlines:
|
||||||
|
|
||||||
|
# case 1 leading comment
|
||||||
|
|
||||||
|
|
||||||
|
case "top level case comment with newlines": # case dangling comment
|
||||||
|
# pass leading comment
|
||||||
|
pass
|
||||||
|
# pass trailing comment
|
||||||
|
|
||||||
|
|
||||||
|
# case 2 leading comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case "case comment with newlines" if foo == 2: # second
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "one", "newline" if (foo := 1): # third
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
case "two newlines":
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case "three newlines":
|
||||||
|
pass
|
||||||
|
case _:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match long_lines:
|
||||||
|
case "this is a long line for if condition" if aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2: # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "this is a long line for if condition with parentheses" if (aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2): # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "named expressions aren't special" if foo := 1:
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "named expressions aren't that special" if (foo := 1):
|
||||||
|
pass
|
||||||
|
|
||||||
|
case "but with already broken long lines" if (
|
||||||
|
aaaaaaahhhhhhhhhhh == 1 and
|
||||||
|
bbbbbbbbaaaaaahhhh == 2
|
||||||
|
): # another comment
|
||||||
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
@ -124,6 +177,52 @@ def foo():
|
||||||
match inside_func: # comment
|
match inside_func: # comment
|
||||||
case NOT_YET_IMPLEMENTED_Pattern:
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match newlines:
|
||||||
|
# case 1 leading comment
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern: # case dangling comment
|
||||||
|
# pass leading comment
|
||||||
|
pass
|
||||||
|
# pass trailing comment
|
||||||
|
|
||||||
|
# case 2 leading comment
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if foo == 2: # second
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if (foo := 1): # third
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
|
pass
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
match long_lines:
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2: # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if (
|
||||||
|
aaaaaaaaahhhhhhhh == 1 and bbbbbbaaaaaaaaaaa == 2
|
||||||
|
): # comment
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if foo := 1:
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if (foo := 1):
|
||||||
|
pass
|
||||||
|
|
||||||
|
case NOT_YET_IMPLEMENTED_Pattern if (
|
||||||
|
aaaaaaahhhhhhhhhhh == 1 and bbbbbbbbaaaaaahhhh == 2
|
||||||
|
): # another comment
|
||||||
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue