Skip to content

dynamic typing

Dynamic typing is a form of type checking in which the types of a program’s values are verified while it runs, rather than before execution. Each value carries its own type, and the language checks that an operation is valid only at the moment it is performed.

Because types travel with values rather than with names, a variable is a label that can be bound to objects of different types over its lifetime. Rebinding a name from a number to a string is allowed, since nothing fixes the name to one type in advance. A type error, such as calling a number as a function, surfaces only when the offending line actually runs, often as a TypeError or its equivalent.

Deferring these checks to runtime is what sets dynamic typing apart from static typing, which rejects programs with type errors before they run. It is a separate question from whether a language is strongly or weakly typed, which concerns how readily mismatched types are coerced rather than when they are checked.

These two axes are independent, which is why a language can sit in any of the four combinations, with Python landing in the dynamic and strongly typed corner:

Two independent axes, static to dynamic and weak to strong, place Python in the dynamic and strong quadrant.
When Checked and How Coerced Are Two Different Axes

Dynamic typing favors flexibility over early guarantees. It supports rapid prototyping, concise code free of type declarations, and duck typing, in which a function accepts any value that supports the operations it uses. The cost is that type mistakes stay hidden until the code path that triggers them executes. Many dynamically typed languages now offer optional type hints to recover some of that early checking.

The Ultimate Guide to Python Type Checking

Tutorial

Python Type Checking (Guide)

In this guide, you'll look at Python type checking. Traditionally, types have been handled by the Python interpreter in a flexible but implicit way. Recent versions of Python allow you to specify explicit type hints that can be used by different tools to help you develop your code more efficiently.

intermediate best-practices

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated Aug. 15, 2026