Files
RustPython/extra_tests/snippets/protocol_callable.py
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00

22 lines
260 B
Python

class Callable:
def __init__(self):
self.count = 0
def __call__(self):
self.count += 1
return self.count
c = Callable()
assert 1 == c()
assert 2 == c()
class Inherited(Callable):
pass
i = Inherited()
assert 1 == i()