mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
PY-77060 Remove spaces after * and ** in new-style PEP 695 type parameters
(cherry picked from commit cd38f49d0f28894e4f33dbd2fa331eaf895fd70d) IJ-CR-148110 GitOrigin-RevId: 99164b1b95b89d7c4b729308c02a8d2800c2f20c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b0321520e6
commit
3d7e118c36
@@ -1361,4 +1361,9 @@ public abstract class PythonCommonFormatterTest extends PythonCommonTestCase {
|
||||
public void testAlignmentInMultilineTypeParameterListInClassDefinition() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-77060
|
||||
public void testSpaceAfterStarInTypeParameterList() {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ public class PythonFormattingModelBuilder implements FormattingModelBuilder, Cus
|
||||
.aroundInside(ADDITIVE_OPERATIONS, BINARY_EXPRESSION).spaceIf(commonSettings.SPACE_AROUND_ADDITIVE_OPERATORS)
|
||||
.aroundInside(STAR_OPERATORS, STAR_PARAMETERS).none()
|
||||
.aroundInside(STAR_OPERATORS, STAR_PATTERNS).none()
|
||||
.aroundInside(STAR_OPERATORS, TYPE_PARAMETER).none()
|
||||
.between(EXCEPT_KEYWORD, MULT).none()
|
||||
.between(PERC, TokenSet.create(PERC, IDENTIFIER, EXPRESSION_STATEMENT)).none()
|
||||
.around(MULTIPLICATIVE_OPERATIONS).spaceIf(commonSettings.SPACE_AROUND_MULTIPLICATIVE_OPERATORS)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
from typing import Callable
|
||||
|
||||
type A[T, * Ts, ** P] = Callable[P, tuple[*Ts, T]]
|
||||
|
||||
|
||||
def f[T, * Ts, ** P]() -> Callable[P, tuple[*Ts, T]]:
|
||||
...
|
||||
|
||||
|
||||
class C[T, * Ts, ** P]:
|
||||
def m(self) -> Callable[P, tuple[*Ts, T]]:
|
||||
...
|
||||
@@ -0,0 +1,12 @@
|
||||
from typing import Callable
|
||||
|
||||
type A[T, *Ts, **P] = Callable[P, tuple[*Ts, T]]
|
||||
|
||||
|
||||
def f[T, *Ts, **P]() -> Callable[P, tuple[*Ts, T]]:
|
||||
...
|
||||
|
||||
|
||||
class C[T, *Ts, **P]:
|
||||
def m(self) -> Callable[P, tuple[*Ts, T]]:
|
||||
...
|
||||
Reference in New Issue
Block a user