From a8086a273793498972af3c8d75f34aab70fe977e Mon Sep 17 00:00:00 2001 From: Real Python Bot <42617967+realpython-bot@users.noreply.github.com> Date: Thu, 22 Oct 2026 06:06:26 +0000 Subject: [PATCH] Sync python-protocol with the maintenance update of Python Protocols: Leveraging Structural Subtyping --- python-protocol/adder_v5.py | 4 ++-- python-protocol/adder_v6.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python-protocol/adder_v5.py b/python-protocol/adder_v5.py index f0b36324df..787c582869 100644 --- a/python-protocol/adder_v5.py +++ b/python-protocol/adder_v5.py @@ -1,8 +1,8 @@ from typing import Protocol -class Adder(Protocol): - def add[T: int | float | str](self, x: T, y: T) -> T: ... +class Adder[T: int | float | str](Protocol): + def add(self, x: T, y: T) -> T: ... class IntAdder: diff --git a/python-protocol/adder_v6.py b/python-protocol/adder_v6.py index 3559ce1a9a..cecba94bf4 100644 --- a/python-protocol/adder_v6.py +++ b/python-protocol/adder_v6.py @@ -1,8 +1,8 @@ from typing import Protocol -class Adder(Protocol): - def add[T: int | float | str](self, x: T, y: T) -> T: ... +class Adder[T: int | float | str](Protocol): + def add(self, x: T, y: T) -> T: ... class IntAdder: