Getting to Know Duck Typing in Python

Negar Vahid
Negar Vahid 13 Lessons 38m intermediate python

Python makes extensive use of a type system known as duck typing. This system is based on an object’s behavior and interface. Many built-in classes and tools support this type system, which makes them pretty flexible and decoupled.

Duck typing is a core concept in Python. Understanding it will give you deeper insight into how the language works and, more importantly, how to use this approach in your own code.

In this video course, you’ll learn:

  • What duck typing is and what its pros and cons are
  • How Python’s classes and tools take advantage of duck typing
  • How special methods and protocols support duck typing
  • What the alternatives to duck typing are in Python

What’s Included:

Downloadable Resources:

Related Learning Paths:

About Negar Vahid

Negar is a Deep Learning and Quantum Computing researcher and Real Python content creator.

» More about Negar

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

← Browse All Courses