with deyimi 1

This commit is contained in:
Mert Gör 🇹🇷 2023-08-22 15:30:55 +03:00
parent 88bd36c361
commit 86a40c5d91
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -0,0 +1,16 @@
class Sample:
def __init__(self):
print('__init__ called')
def __enter__(self):
print('__enter__ called')
return self
def __exit__(self, exc_type, exc_value, traceback):
print('__exit__ called')
return False
print('begins...')
with Sample() as s:
print('suite')
print('ends...')