The following code example, specifically the instantiation of a dictionary containing list of lists, gets marked as illegal by Pylance, which seems to be due a missing type definition in the typshed repo:
employee_titles = [
["Mary", "Senior Manager"],
["Brian", "Vice President"],
["Julie", "Assistant Vice President"],
]
a = dict(employee_titles) # this line gets flagged as invalid by Pylance
print(a)
Error message from Pylance:
No overloads for "dict(employee_titles)" match parameters
Argument types: (List[List[str]]) Pylance (reportGeneralTypeIssues)
The code above runs without any complaints from Python itself. Also, the Python docs state that the positional argument must be an iterable object, and lists are iterable objects:
Otherwise, the positional argument must be an iterable object. Each item in the iterable must itself be an iterable with exactly two objects. The first object of each item becomes a key in the new dictionary, and the second object the corresponding value.
Reference to Pylance issue: microsoft/pylance-release#594
The following code example, specifically the instantiation of a dictionary containing list of lists, gets marked as illegal by Pylance, which seems to be due a missing type definition in the typshed repo:
Error message from Pylance:
The code above runs without any complaints from Python itself. Also, the Python docs state that the positional argument must be an iterable object, and lists are iterable objects:
Reference to Pylance issue: microsoft/pylance-release#594