ruff/crates/ruff_linter/resources/test/fixtures/flake8_builtins/A002.py
Dylan cb003ebe22
[flake8-builtins] Skip lambda expressions in builtin-argument-shadowing (A002) (#14144)
Flake8-builtins provides two checks for arguments (really, parameters)
of a function shadowing builtins: A002 checks function definitions, and
A006 checks lambda expressions. This PR ensures that A002 is restricted
to functions rather than lambda expressions.

Closes #14135 .
2024-11-07 05:34:09 +00:00

27 lines
382 B
Python

def func1(str, /, type, *complex, Exception, **getattr):
pass
async def func2(bytes):
pass
async def func3(id, dir):
pass
# this is Ok for A002 (trigger A005 instead)
# https://github.com/astral-sh/ruff/issues/14135
map([], lambda float: ...)
from typing import override, overload
@override
def func4(id, dir):
pass
@overload
def func4(id, dir):
pass