Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/dynamic_typing.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.. _dynamic-typing:


Dynamically typed code
======================

Expand Down Expand Up @@ -94,6 +93,8 @@ third party libraries that mypy does not know about. This is particularly the ca
when using the :option:`--ignore-missing-imports <mypy --ignore-missing-imports>`
flag. See :ref:`fix-missing-imports` for more information about this.

.. _any-vs-object:

Any vs. object
--------------

Expand Down
5 changes: 5 additions & 0 deletions docs/source/kinds_of_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ operations are permitted on the value, and the operations are only checked
at runtime. You can use ``Any`` as an "escape hatch" when you can't use
a more precise type for some reason.

This should not be confused with the
:py:class:`object` type, which also represents any value, but in a type-safe
way; it's almost always preferable to use ``object`` instead of ``Any``, if
you can do so without great difficulty — see :ref:`any-vs-object` for more.

``Any`` is compatible with every other type, and vice versa. You can freely
assign a value of type ``Any`` to a variable with a more precise type:

Expand Down