Skip to content

Commit 3aede76

Browse files
authored
Update functions_sude_naz_ay.py
1 parent 814010a commit 3aede76

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎Week04/functions_sude_naz_ay.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
3-
import sys
1+
"""Week04 - Introduction to Python: functions."""
42

53
# x positional-only (default 0), e positional-or-keyword (default 1)
64
custom_power = lambda x=0, /, e=1: x ** e
@@ -47,7 +45,7 @@ def fn_w_counter() -> (int, dict[str, int]):
4745
:rtype: tuple[int, dict[str, int]]
4846
"""
4947
global _total_calls
50-
caller = sys._getframe(1).f_globals.get("__name__", "<unknown>")
48+
caller = __name__
5149
_total_calls += 1
5250
_call_counts[caller] = _call_counts.get(caller, 0) + 1
5351
return _total_calls, dict(_call_counts)

0 commit comments

Comments
 (0)