multiple changes

This commit is contained in:
www
2021-01-11 18:45:03 +00:00
parent 14ca632137
commit 3d3474a2e1
24 changed files with 3517 additions and 83 deletions

View File

@@ -1,6 +1,29 @@
from contextlib import contextmanager
class A():
def b(self):
return "Hello"
@property
def cm(self):
@contextmanager
def stuff():
print("start")
try:
yield None
#yield 2
except Exception:
pass
print("end")
return stuff
def p(self):
with self.cm() as i:
print(f"{i} middle")
raise Exception
a=A()
print(callable(getattr(a,"b")))
print(getattr(a, "b")())
a.p()