Skip to content

Commit e30d37f

Browse files
committed
learn python decorator
1 parent e5dab3e commit e30d37f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

python/index.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,17 @@ def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:
284284
y = 4
285285
points = [[1,2],[3,1],[2,4],[2,3],[4,4]]
286286
# 2
287-
print(c.nearestValidPoint(x,y,points))
287+
# print(c.nearestValidPoint(x,y,points))
288+
289+
def showResult(func):
290+
def wrap():
291+
print("run this one first")
292+
func()
293+
print("run this at the end")
294+
return wrap
295+
296+
@showResult
297+
def say():
298+
print("then run this function")
299+
300+
say()

0 commit comments

Comments
 (0)