Skip to content

Commit c5edc5c

Browse files
committed
TR updates, second round
1 parent bd391f0 commit c5edc5c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

syntactic-sugar-python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Syntactic Sugar in Python: Making Your Code Pythonic
1+
# Syntactic Sugar: Why Python is Sweet and Pythonic
22

3-
This folder provides the code examples for the Real Python tutorial [Syntactic Sugar in Python: Making Your Code Pythonic](https://realpython.com/python-syntactic-sugar/).
3+
This folder provides the code examples for the Real Python tutorial [Syntactic Sugar: Why Python is Sweet and Pythonic](https://realpython.com/python-syntactic-sugar/).

syntactic-sugar-python/circle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ def __init__(self, radius):
88
def area(self):
99
return pi * self.radius**2
1010

11-
def perimeter(self):
11+
def circumference(self):
1212
return 2 * pi * self.radius
1313

1414

1515
circle = Circle(10)
1616
print(circle.radius)
1717
print(circle.area())
18-
print(circle.perimeter())
18+
print(circle.circumference())

syntactic-sugar-python/timing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
def timer(func):
66
@functools.wraps(func)
77
def _timer(*args, **kwargs):
8-
start = time.time()
8+
start = time.perf_counter()
99
result = func(*args, **kwargs)
10-
end = time.time()
10+
end = time.perf_counter()
1111
print(f"Execution time: {end - start:.4f} seconds")
1212
return result
1313

0 commit comments

Comments
 (0)