News

When to use a Python dictionary. Using Python dictionaries makes the most sense under the following conditions: You want to store objects and data using names, not just positions or index numbers.
You can describe the types for a dictionary by hinting with dict[<key type>, ... and you’re using Python 3.11 or later, you can import Self from the typing module and use that as a hint.