mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
[pycodestyle
] Avoid false positives related to type aliases (E252
) (#15356)
This commit is contained in:
parent
ee9a912f47
commit
3820af2f1b
2 changed files with 13 additions and 1 deletions
|
@ -79,3 +79,15 @@ class PEP696Good[A = int, B: object = str, C:object = memoryview]:
|
|||
|
||||
# https://github.com/astral-sh/ruff/issues/15202
|
||||
type Coro[T: object = Any] = Coroutine[None, None, T]
|
||||
|
||||
|
||||
# https://github.com/astral-sh/ruff/issues/15339
|
||||
type A = Annotated[
|
||||
str, Foo(lorem='ipsum')
|
||||
]
|
||||
type B = Annotated[
|
||||
int, lambda a=1: ...
|
||||
]
|
||||
type C = Annotated[
|
||||
int, lambda a: ..., lambda a=1: ...
|
||||
]
|
||||
|
|
|
@ -531,7 +531,7 @@ impl DefinitionState {
|
|||
Self::NotInDefinition => return,
|
||||
};
|
||||
match token_kind {
|
||||
TokenKind::Lpar if type_params_state_mut.before_type_params() => {
|
||||
TokenKind::Lpar | TokenKind::Equal if type_params_state_mut.before_type_params() => {
|
||||
*type_params_state_mut = TypeParamsState::TypeParamsEnded;
|
||||
}
|
||||
TokenKind::Lsqb => match type_params_state_mut {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue