Skip to content

Commit e259fed

Browse files
authored
Merge branch 'main' into assign-required-fields
2 parents 91bd352 + 00b33a5 commit e259fed

13 files changed

+17
-45
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,7 @@ repos:
6363
types: [python]
6464
args: []
6565
require_serial: true
66-
additional_dependencies:
67-
[
68-
"types-pkg_resources==0.1.3",
69-
"types-six",
70-
"types-attrs",
71-
"types-python-dateutil",
72-
"types-typed-ast",
73-
]
66+
additional_dependencies: ["types-typed-ast"]
7467
exclude: tests/testdata| # exclude everything, we're not ready
7568
- repo: https://github.com/pre-commit/mirrors-prettier
7669
rev: v3.0.0-alpha.6

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Release date: TBA
1212

1313
* Improved signature of the ``__init__`` and ``__postinit__`` methods of the following nodes:
1414
- ``nodes.Assign``
15+
- ``nodes.Delete``
1516
- ``nodes.If``
1617
- ``nodes.IfExp``
1718

astroid/nodes/node_classes.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,26 +2238,13 @@ class Delete(_base_nodes.AssignTypeNode, _base_nodes.Statement):
22382238

22392239
def __init__(
22402240
self,
2241-
lineno: int | None = None,
2242-
col_offset: int | None = None,
2243-
parent: NodeNG | None = None,
2241+
lineno: int,
2242+
col_offset: int,
2243+
parent: NodeNG,
22442244
*,
2245-
end_lineno: int | None = None,
2246-
end_col_offset: int | None = None,
2245+
end_lineno: int | None,
2246+
end_col_offset: int | None,
22472247
) -> None:
2248-
"""
2249-
:param lineno: The line that this node appears on in the source code.
2250-
2251-
:param col_offset: The column that this node appears on in the
2252-
source code.
2253-
2254-
:param parent: The parent node in the syntax tree.
2255-
2256-
:param end_lineno: The last line this node appears on in the source code.
2257-
2258-
:param end_col_offset: The end column this node appears on in the
2259-
source code. Note: This is after the last symbol.
2260-
"""
22612248
self.targets: list[NodeNG] = []
22622249
"""What is being deleted."""
22632250

@@ -2269,13 +2256,8 @@ def __init__(
22692256
parent=parent,
22702257
)
22712258

2272-
def postinit(self, targets: list[NodeNG] | None = None) -> None:
2273-
"""Do some setup after initialisation.
2274-
2275-
:param targets: What is being deleted.
2276-
"""
2277-
if targets is not None:
2278-
self.targets = targets
2259+
def postinit(self, targets: list[NodeNG]) -> None:
2260+
self.targets = targets
22792261

22802262
def get_children(self):
22812263
yield from self.targets

requirements_test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
contributors-txt>=0.7.4
44
tbump~=6.9.0
55
types-typed-ast; implementation_name=="cpython" and python_version<"3.8"
6-
types-pkg_resources==0.1.3

requirements_test_brain.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
attrs
2-
types-attrs
32
nose
43
numpy>=1.17.0; python_version<"3.11"
54
python-dateutil
65
PyQt6
76
regex
8-
types-python-dateutil
97
six
10-
types-six
118
urllib3
129
typing_extensions>=4.4.0

tests/brain/test_attr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from astroid import nodes
1111

1212
try:
13-
import attr as attr_module # pylint: disable=unused-import
13+
import attr # type: ignore[import] # pylint: disable=unused-import
1414

1515
HAS_ATTR = True
1616
except ImportError:

tests/brain/test_dateutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from astroid import builder
1010

1111
try:
12-
import dateutil # pylint: disable=unused-import
12+
import dateutil # type: ignore[import] # pylint: disable=unused-import
1313

1414
HAS_DATEUTIL = True
1515
except ImportError:

tests/brain/test_regex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
44

55
try:
6-
import regex
6+
import regex # type: ignore[import]
77

88
HAS_REGEX = True
99
except ImportError:

tests/brain/test_six.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from astroid.nodes.scoped_nodes import ClassDef
1313

1414
try:
15-
import six # pylint: disable=unused-import
15+
import six # type: ignore[import] # pylint: disable=unused-import
1616

1717
HAS_SIX = True
1818
except ImportError:

tests/test_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from . import resources
3737

3838
try:
39-
import six # pylint: disable=unused-import
39+
import six # type: ignore[import] # pylint: disable=unused-import
4040

4141
HAS_SIX = True
4242
except ImportError:

tests/test_modutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from . import resources
2727

2828
try:
29-
import urllib3 # pylint: disable=unused-import
29+
import urllib3 # type: ignore[import] # pylint: disable=unused-import
3030

3131
HAS_URLLIB3 = True
3232
except ImportError:

tests/test_object_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from astroid.exceptions import InferenceError
1414

1515
try:
16-
import six # pylint: disable=unused-import
16+
import six # type: ignore[import] # pylint: disable=unused-import
1717

1818
HAS_SIX = True
1919
except ImportError:

tests/test_scoped_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
from . import resources
4848

4949
try:
50-
import six # pylint: disable=unused-import
50+
import six # type: ignore[import] # pylint: disable=unused-import
5151

5252
HAS_SIX = True
5353
except ImportError:

0 commit comments

Comments
 (0)