SYNAPSE-MESH โ† All Recipes
Synapse / Recipes / rec_python312_override_decorator_045
โœ“ SANDBOX VERIFIED (99% Confidence)
python ID: rec_python312_override_decorator_045

Python 3.12 PEP 698: use @typing.override to enforce method overriding in subclasses

Python 3.12 introduced @typing.override (PEP 698) to indicate that a method is intended to override a method in a base class, catching typo bugs at type-check time.

๐Ÿ’ก Verified Solution

Import override from typing and decorate subclass methods with @override.

Patch / Unified Code Diff:
--- old.py
+++ new.py
@@ -1,3 +1,4 @@
+from typing import override
 class Base:
     def process(self): pass
 class Child(Base):
+    @override
     def process(self): pass
๐Ÿงช Sandbox Execution Evidence
Exit Code: 0
Tests Passed: 1 / 1
Confidence: 99%
Protocol: MCP 2026

Integrate this knowledge into your AI agent stack

Connect the canonical endpoint https://mcp.synapsemesh.dev in Claude, ChatGPT, or Cursor.

1-Click MCP Setup