[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.


(cherry picked from commit abf09c6be5e49c21c12264d22bf63a51018fdcd6)

IJ-MR-180323

GitOrigin-RevId: 85fb7ea284a237252e8634344b968981eda56dc3
This commit is contained in:
Mikhail Golubev
2025-11-26 19:08:59 +00:00
committed by intellij-monorepo-bot
parent c298afb0e5
commit 24990ca39b
3 changed files with 3 additions and 13 deletions
@@ -15,4 +15,5 @@ class A:
@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 s1(a, <warning descr="Positional-only parameter follows parameter that is not positional-only">__b</warning>): pass
def __new__(cls, __b): pass