Skip to content

Commit

Permalink
TR updates, second round
Browse files Browse the repository at this point in the history
  • Loading branch information
lpozo committed Sep 17, 2024
1 parent bd391f0 commit c5edc5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions syntactic-sugar-python/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Syntactic Sugar in Python: Making Your Code Pythonic
# Syntactic Sugar: Why Python is Sweet and Pythonic

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/).
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/).
4 changes: 2 additions & 2 deletions syntactic-sugar-python/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def __init__(self, radius):
def area(self):
return pi * self.radius**2

def perimeter(self):
def circumference(self):
return 2 * pi * self.radius


circle = Circle(10)
print(circle.radius)
print(circle.area())
print(circle.perimeter())
print(circle.circumference())
4 changes: 2 additions & 2 deletions syntactic-sugar-python/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def timer(func):
@functools.wraps(func)
def _timer(*args, **kwargs):
start = time.time()
start = time.perf_counter()
result = func(*args, **kwargs)
end = time.time()
end = time.perf_counter()
print(f"Execution time: {end - start:.4f} seconds")
return result

Expand Down

0 comments on commit c5edc5c

Please sign in to comment.