Files
openide/python/testData/highlighting/historicalPositionalOnlyParameters.py
Mikhail Golubevandintellij-monorepo-bot aea9e8688f [python] PY-85031 Use PyAstNamedParameter.isSelf when reporting legacy positional-only parameters
It correctly takes into account the first argument of `__new__` that is also implicit,
and thus should be excluded when reporting positional-only parameters following
non-positional-only ones.

GitOrigin-RevId: abf09c6be5e49c21c12264d22bf63a51018fdcd6
2025-10-28 15:32:15 +00:00

19 lines
815 B
Python

def f1(a, <warning descr="Positional-only parameter follows parameter that is not positional-only">__b</warning>): pass
def f2(__b, a): pass
def f3(a, /, __b): pass
def f4(a, *, __b): pass
def f5(a, *args, __b): pass
def f6(a, __b__, __): pass
class A:
def m1(self, __b): pass
def m2(self, a, <warning descr="Positional-only parameter follows parameter that is not positional-only">__b</warning>): pass
@classmethod
def c1(cls, __b): pass
@classmethod
def c2(cls, a, <warning descr="Positional-only parameter follows parameter that is not positional-only">__b</warning>): pass
@staticmethod
def s1(__b): pass
@staticmethod
def s1(a, <warning descr="Positional-only parameter follows parameter that is not positional-only">__b</warning>): pass
def __new__(cls, __b): pass