-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Needs triage 📥Just created, needs acknowledgment, triage, and proper labellingJust created, needs acknowledgment, triage, and proper labelling
Description
Bug description
I subclass datetime.datetime
for some specific needs, but with the new 4.0 version of pylint, I see E1121 when I try the following:
import datetime
from typing import Self
class MyDateTime(datetime.datetime):
def __new__(
cls,
firstArg: object,
month: int | None = None,
day: int | None = None,
hour: int = 0,
minute: int = 0,
second: int = 0,
microsecond: int = 0,
) -> Self:
return super().__new__(
cls, firstArg, month, day, hour, minute, second, microsecond
)
I think this is pretty valid (I tried to strip out as much as I could to repro), and this instantiates fine
In [3]: MyDateTime(1,1,1)
Out[3]: MyDateTime(1, 1, 1, 0, 0)
Am I misreading the issue, or is something off with pylint's interpretation
Configuration
Command used
pylint --rcfile /dev/null --disable all --enable E1121 x.py
Pylint output
************* Module x
x.py:17:15: E1121: Too many positional arguments for classmethod call (too-many-function-args)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 8.89/10, -8.89)
Expected behavior
"10/10, would lint again"
Pylint version
pylint 4.0.1
astroid 4.0.1
Python 3.11.13
OS / Environment
Debian
Additional dependencies
Metadata
Metadata
Assignees
Labels
Needs triage 📥Just created, needs acknowledgment, triage, and proper labellingJust created, needs acknowledgment, triage, and proper labelling