The docstring of dict() doesn't match the doc of dict() and it isn't so understandable as shown below:
print(help(dict))
# class dict(object)
# | dict() -> new empty dictionary
# | dict(mapping) -> new dictionary initialized from a mapping object's
# | (key, value) pairs
# | dict(iterable) -> new dictionary initialized as if via:
# | d = {}
# | for k, v in iterable:
# | d[k] = v
# | dict(**kwargs) -> new dictionary initialized with the name=value pairs
# | in the keyword argument list. For example: dict(one=1, two=2)
So, it should be like below:
dict(**kwargs) -> E.g. dict(key1=value1, key2=value2)
dict(mapping, **kwargs) -> mapping is the dictionary made by mapping object
dict(iterable, **kwargs) -> iterable is e.g. [('key1', 'value1'), ('key2', 'value2')]) treated by {k:v for k, v in iterable}
The docstring of dict() doesn't match the doc of
dict()and it isn't so understandable as shown below:So, it should be like below: