Skip to content

Commit 88a046c

Browse files
committed
Merge branch 'main' into overload
2 parents 137e3fc + 4c02514 commit 88a046c

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

conformance/results/mypy/dataclasses_descriptors.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
conformant = "Partial"
22
notes = """
3+
Assumes descriptor behavior only when field is assigned in class body.
34
Does not correctly evaluate type of descriptor access.
45
"""
56
output = """

conformance/results/mypy/tuples_type_compat.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
conformant = "Partial"
22
notes = """
33
Does not support tuple narrowing based on `len()` type guard (optional).
4+
Incorrectly marks a match case as unreachable.
45
"""
56
output = """
67
tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment]

conformance/results/results.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ <h3>Python Type System Conformance Test Results</h3>
814814
<a class="test_group" href="https://typing.readthedocs.io/en/latest/spec/dataclasses.html">Dataclasses</a>
815815
</th></tr>
816816
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataclasses_descriptors</th>
817-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not correctly evaluate type of descriptor access.</p></span></div></th>
817+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Assumes descriptor behavior only when field is assigned in class body.</p><p>Does not correctly evaluate type of descriptor access.</p></span></div></th>
818818
<th class="column col2 conformant">Pass</th>
819819
<th class="column col2 conformant">Pass</th>
820820
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>* Assumes descriptor behavior only when field is assigned in class body</p><p>* Doesn't allow non-data descriptors or data descriptors with differing `__get__` and `__set__` types</p></span></div></th>
@@ -1030,7 +1030,7 @@ <h3>Python Type System Conformance Test Results</h3>
10301030
<a class="test_group" href="https://typing.readthedocs.io/en/latest/spec/tuples.html">Tuples</a>
10311031
</th></tr>
10321032
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tuples_type_compat</th>
1033-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support tuple narrowing based on `len()` type guard (optional).</p></span></div></th>
1033+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support tuple narrowing based on `len()` type guard (optional).</p><p>Incorrectly marks a match case as unreachable.</p></span></div></th>
10341034
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Incorrectly marks a match case as unreachable.</p></span></div></th>
10351035
<th class="column col2 conformant">Pass</th>
10361036
<th class="column col2 conformant">Pass</th>

conformance/tests/dataclasses_transform_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def model_field(
2525
class ModelMeta(type):
2626
not_a_field: str
2727

28-
def __init__(self, not_a_field: str) -> None:
29-
self.not_a_field = not_a_field
28+
def __init__(self, *args, **kwargs) -> None:
29+
self.not_a_field: str = "not a field"
3030

3131

3232
class ModelBase(metaclass=ModelMeta):

conformance/tests/protocols_class_objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class ConcreteC2:
9393
class CMeta(type):
9494
attr1: int
9595

96-
def __init__(self, attr1: int) -> None:
97-
self.attr1 = attr1
96+
def __init__(self, *args, **kwargs) -> None:
97+
self.attr1: int = 1
9898

9999

100100
class ConcreteC3(metaclass=CMeta):

docs/spec/enums.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ behaviors::
7878
reveal_type(Color["RED"]) # Revealed type is 'Literal[Color.RED]' (or 'Color')
7979
reveal_type(Color(3)) # Revealed type is 'Literal[Color.BLUE]' (or 'Color')
8080

81-
Unlike most Python classes, Calling an enum class does not invoke its constructor.
81+
Unlike most Python classes, calling an enum class does not invoke its constructor.
8282
Instead, the call performs a value-based lookup of an enum member.
8383

8484
An Enum class with one or more defined members cannot be subclassed. They are
@@ -266,10 +266,10 @@ tuple values and the constructor signature::
266266
self.mass = mass
267267
self.radius = radius
268268

269-
MERCURY = (1, 3.303e+23, 2.4397e6)
270-
VENUS = (2, 4.869e+24, 6.0518e6)
271-
EARTH = (3, 5.976e+24, 6.37814e6)
272-
MARS = (6.421e+23, 3.3972e6) # Type checker error (optional)
269+
MERCURY = (1, 3.301e+23, 2.4397e6)
270+
VENUS = (2, 4.867e+24, 6.0518e6)
271+
EARTH = (3, 5.972e+24, 6.37814e6)
272+
MARS = (6.417e+23, 3.3962e6) # Type checker error (optional)
273273
JUPITER = 5 # Type checker error (optional)
274274

275275
reveal_type(Planet.MERCURY.value) # Revealed type is Literal[1] (or int or object or Any)
@@ -302,7 +302,7 @@ checkers should enforce this declared type when values are assigned to
302302
def __init__(self, value: int, mass: float, radius: float):
303303
self._value_ = value # Type error
304304

305-
MERCURY = (1, 3.303e+23, 2.4397e6)
305+
MERCURY = (1, 3.301e+23, 2.4397e6)
306306

307307
If the literal values for enum members are not supplied, as they sometimes
308308
are not within a type stub file, a type checker can use the type of the

0 commit comments

Comments
 (0)