Python Metaprogramming

Difficulty: Beginner
Duration: 30 seconds
Students: 2,553
Rating: 3.5/5

This training lesson provides you with a deep dive into how to use metaprogramming to dynamically alter the behavior of Python scripts at runtime, using techniques such as monkey patching.

Learning Objectives

  • Understand what metaprogramming is and what it can be used for
  • Review how to access local and global variables by name
  • Know how to inspect the details of any object at runtime
  • Know how to manipulate the behavior of an object runtime through the use of monkey patching
  • And finally, understand how to create and use decorators for classes and functions

Prerequisites

  • A basic understanding of the Python programming language
  • A basic understanding of software development
  • A basic understanding of the software development life cycle

Intended Audience

  • Software developers interested in learning how to write Python code in a Pythonic way
  • Python junior-level developers interested in advancing their Python skills 
  • Anyone with an interest in Python and how to use Python to write concise and elegant scripts for general purpose tasks
Covered Topics
Trivera
This content is developed in partnership with Trivera
Learn more