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
Python version (& distribution if applicable, e.g., Anaconda): 3.10
Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv
Operating system (and version): Windows 10, current version
Version of tool extension you are using: current version of Mypy from a fresh install, no modifications
Behaviour
Expected Behavior
For no errors to be found.
Actual Behavior
I got an error and this is it:
"Sequence[Collection[str]]" has no attribute "append"Mypyattr-defined
(function) append: Any
Reproduction Steps:
Create a new python file
Create a collection that has another collection within that python file (eg: python list that contains a dictionary that contains a list)
Write code that uses any built-in method on an double-nested collection
Example:
stores = [
{
"name": "My Store",
"items": [
{
"name": "Chair",
"price": 15.99
}
]
}
]
for store in stores:
if store["name"] == "pie":
new_item = {"name": "request_data", "price": "price"}
store["items"].append(new_item)
On line 16 of the example, Mypy detects an error with using the append method on the list within stores[0]["items"], aka store["items"]. But store["items"] is a list and can use the append method, this code runs without issue.
Logs:
Click here for detailed logs
2024-06-15 00:12:13.849 [info] file:///c%3A/...etc.../app.py :
c:\Users\...etc...\app.py:34:13:34:33: error: "Sequence[Collection[str]]" has no attribute "append" [attr-defined]
Diagnostic Data
Behaviour
Expected Behavior
For no errors to be found.
Actual Behavior
I got an error and this is it:
"Sequence[Collection[str]]" has no attribute "append"Mypyattr-defined
(function) append: Any
Reproduction Steps:
Example:
On line 16 of the example, Mypy detects an error with using the append method on the list within stores[0]["items"], aka store["items"]. But store["items"] is a list and can use the append method, this code runs without issue.
Logs:
Click here for detailed logs
2024-06-15 00:12:13.849 [info] file:///c%3A/...etc.../app.py : c:\Users\...etc...\app.py:34:13:34:33: error: "Sequence[Collection[str]]" has no attribute "append" [attr-defined]Extra Details
Other Python extensions: isort, Pylance, Python Debugger, Python
Project structure (square brackets represent folders):
[pycache]
[.mypy_cache]
[.venv]
app.py
The text was updated successfully, but these errors were encountered: