From dba864aef1fe019224ef99e839b7382ef7d57a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 30 Apr 2025 04:51:49 +0200 Subject: [PATCH] Duck types --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c8358e4..8a41909 100644 --- a/README.md +++ b/README.md @@ -1156,7 +1156,7 @@ class MySortable: * **Any object that has methods next() and iter() is an iterator.** * **Next() should return next item or raise StopIteration exception.** * **Iter() should return an iterator of remaining items, i.e. 'self'.** -* **Only objects that have iter() method can be used in for loops.** +* **Any object that has iter() method can be used in a for loop.** ```python class Counter: def __init__(self): diff --git a/index.html b/index.html index 7c52e27..df7e543 100644 --- a/index.html +++ b/index.html @@ -989,7 +989,7 @@ P = make_dataclass('P', [(class Counter: def __init__(self): self.i = 0