You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conformance suite is questionable; see https://github.com/python/typing/issues/2259
3
+
Does not preserve a non-data descriptor object stored in a dataclass instance when a class attribute of the same name is also present.
4
+
Does not preserve type parameters when accessing a non-data descriptor through the dataclass.
4
5
"""
5
6
conformance_automated = "Fail"
6
7
errors_diff = """
7
-
Line 61: Unexpected errors ['./dataclasses_descriptors.py:61:12: Any[error] is not equivalent to list[int]', "./dataclasses_descriptors.py:61:12: <class 'DC2'> has no attribute 'x' [undefined_attribute]"]
8
-
Line 62: Unexpected errors ['./dataclasses_descriptors.py:62:12: Any[error] is not equivalent to list[str]', "./dataclasses_descriptors.py:62:12: <class 'DC2'> has no attribute 'y' [undefined_attribute]"]
9
-
Line 63: Unexpected errors ['./dataclasses_descriptors.py:63:12: list[Any[generic_argument]] is not equivalent to list[str]']
10
-
Line 66: Unexpected errors ['./dataclasses_descriptors.py:66:12: ./dataclasses_descriptors.py.Desc2[int] is not equivalent to int']
11
-
Line 67: Unexpected errors ['./dataclasses_descriptors.py:67:12: ./dataclasses_descriptors.py.Desc2[str] is not equivalent to str']
12
-
Line 68: Unexpected errors ['./dataclasses_descriptors.py:68:12: Any[generic_argument] is not equivalent to str']
8
+
Line 76: Unexpected errors ['.\\\\dataclasses_descriptors.py:76:12: list[Any[generic_argument]] is not equivalent to list[str]']
9
+
Line 85: Unexpected errors ['.\\\\dataclasses_descriptors.py:85:12: Any[generic_argument] is not equivalent to .\\\\dataclasses_descriptors.py.Desc2[str]']
13
10
"""
14
11
output = """
15
-
./dataclasses_descriptors.py:61:12: Any[error] is not equivalent to list[int]
16
-
./dataclasses_descriptors.py:61:12: <class 'DC2'> has no attribute 'x' [undefined_attribute]
17
-
./dataclasses_descriptors.py:62:12: Any[error] is not equivalent to list[str]
18
-
./dataclasses_descriptors.py:62:12: <class 'DC2'> has no attribute 'y' [undefined_attribute]
19
-
./dataclasses_descriptors.py:63:12: list[Any[generic_argument]] is not equivalent to list[str]
20
-
./dataclasses_descriptors.py:66:12: ./dataclasses_descriptors.py.Desc2[int] is not equivalent to int
21
-
./dataclasses_descriptors.py:67:12: ./dataclasses_descriptors.py.Desc2[str] is not equivalent to str
22
-
./dataclasses_descriptors.py:68:12: Any[generic_argument] is not equivalent to str
12
+
.\\dataclasses_descriptors.py:74:12: Any[error] is not equivalent to .\\dataclasses_descriptors.py.Desc2[int]
13
+
.\\dataclasses_descriptors.py:74:12: <class 'DC2'> has no attribute 'x' [undefined_attribute]
14
+
.\\dataclasses_descriptors.py:75:12: Any[error] is not equivalent to .\\dataclasses_descriptors.py.Desc2[str]
15
+
.\\dataclasses_descriptors.py:75:12: <class 'DC2'> has no attribute 'y' [undefined_attribute]
16
+
.\\dataclasses_descriptors.py:76:12: list[Any[generic_argument]] is not equivalent to list[str]
17
+
.\\dataclasses_descriptors.py:85:12: Any[generic_argument] is not equivalent to .\\dataclasses_descriptors.py.Desc2[str]
Does not preserve non-data descriptor objects stored in dataclass instances.
4
+
"""
2
5
output = """
6
+
dataclasses_descriptors.py:74:13 - error: "assert_type" mismatch: expected "Desc2[int]" but received "list[int]" (reportAssertTypeFailure)
7
+
dataclasses_descriptors.py:75:13 - error: "assert_type" mismatch: expected "Desc2[str]" but received "list[str]" (reportAssertTypeFailure)
8
+
dataclasses_descriptors.py:83:13 - error: "assert_type" mismatch: expected "Desc2[int]" but received "int" (reportAssertTypeFailure)
9
+
dataclasses_descriptors.py:84:13 - error: "assert_type" mismatch: expected "Desc2[str]" but received "str" (reportAssertTypeFailure)
10
+
dataclasses_descriptors.py:85:13 - error: "assert_type" mismatch: expected "Desc2[str]" but received "str" (reportAssertTypeFailure)
3
11
"""
4
-
conformance_automated = "Pass"
12
+
conformance_automated = "Fail"
5
13
errors_diff = """
14
+
Line 83: Unexpected errors ['dataclasses_descriptors.py:83:13 - error: "assert_type" mismatch: expected "Desc2[int]" but received "int" (reportAssertTypeFailure)']
15
+
Line 84: Unexpected errors ['dataclasses_descriptors.py:84:13 - error: "assert_type" mismatch: expected "Desc2[str]" but received "str" (reportAssertTypeFailure)']
16
+
Line 85: Unexpected errors ['dataclasses_descriptors.py:85:13 - error: "assert_type" mismatch: expected "Desc2[str]" but received "str" (reportAssertTypeFailure)']
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="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>
904
-
<thclass="column col2 conformant">Pass</th>
905
-
<thclass="column col2 conformant">Pass</th>
906
-
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="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>
907
-
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Conformance suite is questionable; see https://github.com/python/typing/issues/2259</p></span></div></th>
908
-
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Only infers a descriptor `__get__` method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace.</p></span></div></th>
903
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not preserve a non-data descriptor object stored in a dataclass instance when a class attribute of the same name is also present.</p></span></div></th>
904
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not preserve non-data descriptor objects stored in dataclass instances.</p></span></div></th>
905
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not preserve non-data descriptor objects stored in dataclass instances.</p></span></div></th>
906
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Rejects a data descriptor field whose `__get__` and `__set__` have differing types.</p><p>Does not preserve a non-data descriptor object stored in a dataclass instance when a class attribute of the same name is also present.</p></span></div></th>
907
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not preserve a non-data descriptor object stored in a dataclass instance when a class attribute of the same name is also present.</p><p>Does not preserve type parameters when accessing a non-data descriptor through the dataclass.</p></span></div></th>
908
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not preserve non-data descriptor objects stored in dataclass instances.</p></span></div></th>
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Wrongly requires a Final dataclass field to be initialized at class level.</p><p>Doesn't support Final nested inside ClassVar.</p></span></div></th>
Only infers a descriptor `__get__` method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace.
4
+
Does not preserve non-data descriptor objects stored in dataclass instances.
5
5
"""
6
6
errors_diff = """
7
-
Line 66: Unexpected errors ['dataclasses_descriptors.py:66:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `int`']
8
-
Line 67: Unexpected errors ['dataclasses_descriptors.py:67:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `str`']
7
+
Line 83: Unexpected errors ['dataclasses_descriptors.py:83:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `Desc2[int]`']
8
+
Line 84: Unexpected errors ['dataclasses_descriptors.py:84:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `Desc2[str]`']
9
+
Line 85: Unexpected errors ['dataclasses_descriptors.py:85:1: error[type-assertion-failure] Type `str` does not match asserted type `Desc2[str]`']
9
10
"""
10
11
output = """
11
-
dataclasses_descriptors.py:66:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `int`
12
-
dataclasses_descriptors.py:67:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `str`
12
+
dataclasses_descriptors.py:74:1: error[type-assertion-failure] Type `list[int]` does not match asserted type `Desc2[int]`
13
+
dataclasses_descriptors.py:75:1: error[type-assertion-failure] Type `list[str]` does not match asserted type `Desc2[str]`
14
+
dataclasses_descriptors.py:83:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `Desc2[int]`
15
+
dataclasses_descriptors.py:84:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `Desc2[str]`
16
+
dataclasses_descriptors.py:85:1: error[type-assertion-failure] Type `str` does not match asserted type `Desc2[str]`
0 commit comments