Introduction to Metaclasses

Hard Design Patterns & Final Challenges PRO
🔒 Login to Unlock

Problem Statement

Create a metaclass `UpperAttrMeta` that hooks into class creation and converts all non-dunder (not starting with ‘__’) class attribute names to uppercase. Create a `Config` class using this metaclass, defining `timeout = 10`. Print the attribute dynamically to verify it was capitalized.

Input Format

None

Output Format

Print 'TIMEOUT: 10'.

Constraints

None

Sample Output

TIMEOUT: 10

Explanation

Metaclasses intercept the creation of a class object itself, letting you modify the class dictionary before it is fully formed.

Starter Code

class UpperAttrMeta(type):
    # Override __new__
    pass

# Implement Config using metaclass
class Config:
    timeout = 10

if __name__ == '__main__':
    # Print the capitalized attribute
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used