Skip to content

Commit 2a365f5

Browse files
Update functions_mehmet_mert_yigit.py
1 parent 2e5fcdd commit 2a365f5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎Week04/functions_mehmet_mert_yigit.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def custom_equation(
8-
x: int,
8+
x: int = 0,
99
y: int = 0,
1010
/,
1111
a: int = 1,
@@ -27,12 +27,12 @@ def custom_equation(
2727
return float((x ** a + y ** b) / c)
2828

2929

30-
def fn_w_counter() -> tuple[int, dict[str, int]]:
30+
def fn_w_counter() -> (int, dict[str, int]):
3131
if not hasattr(fn_w_counter, "counts"):
3232
fn_w_counter.counts = {}
3333

34-
caller = inspect.currentframe().f_back
35-
caller_name = caller.f_code.co_name
34+
frame = inspect.currentframe().f_back
35+
caller_name = frame.f_globals.get("__name__", "__main__")
3636

3737
counts = fn_w_counter.counts
3838
counts[caller_name] = counts.get(caller_name, 0) + 1

0 commit comments

Comments
 (0)