Skip to content

Commit 93776ca

Browse files
authored
four times..
1 parent c914eda commit 93776ca

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎Week04/functions_batuhan_keskin.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Week04 - Introduction to Python: functions."""
22

3-
import sys
4-
53
# x positional-only (default 0), e positional-or-keyword (default 1)
64
custom_power = lambda x=0, /, e=1: x ** e
75

@@ -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)