Asked about Type hints and pydantic

What does dict | None mean in a return type?

An answer that works

The function returns either a dictionary or None. A type checker will then warn if you use the result without checking for None first. Older syntax writes it as Optional[dict].

Reading an answer is not being able to give one. The section that teaches this is Type hints and pydantic, 4 hours of Python.

Learn this properly