From 7a9d46295a497669eaa6e647c33ab71c8cf620a1 Mon Sep 17 00:00:00 2001 From: Kirill Podoprigora Date: Sat, 17 May 2025 14:11:19 +0100 Subject: [PATCH] gh-88275: Add missing `__init__` method to `match` example (#120281) --- Doc/whatsnew/3.10.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index f5e38950756a..1067601c6523 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -551,11 +551,12 @@ Patterns and classes If you are using classes to structure your data, you can use as a pattern the class name followed by an argument list resembling a constructor. This -pattern has the ability to capture class attributes into variables:: +pattern has the ability to capture instance attributes into variables:: class Point: - x: int - y: int + def __init__(self, x, y): + self.x = x + self.y = y def location(point): match point: -- 2.47.3