DEV Community

Cover image for What is Duck Typing? How Dynamic Type Checking Works in Python, Ruby, and Go
Kenta Takeuchi
Kenta Takeuchi

Posted on • Originally published at bmf-tech.com

What is Duck Typing? How Dynamic Type Checking Works in Python, Ruby, and Go

This article was originally published on bmf-tech.com.

Overview

A summary of duck typing

What is Duck Typing

  • In dynamically typed object-oriented programming languages, what an object can do is determined by the object itself.
  • An object that has all the methods of an interface can be considered to implement the interface, even if it does not explicitly implement it.
  • If it walks like a duck and quacks like a duck, it must be a duck.

References

Top comments (0)