mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00

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 .
27 lines
382 B
Python
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
|