Patterns for dynamic languages

Python is a dynamic language like Lisp. The dynamic nature of Python can be represented as follows:

  • Types or classes are objects at runtime.
  • Variables can have type as a value and can be modified at runtime. For example, a = 5 and a = "John", the a variable is assigned at runtime and type also gets changed.
  • Dynamic languages have more flexibility in terms of class restrictions.
  • For example, in Python, polymorphism is built into the language, there are no keywords such as private and protected and everything is public by default.
  • Represents a case where design patterns can be easily implemented in dynamic languages.

Get Python: Master the Art of Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.