Skip to content

Commit 4d4dbf5

Browse files
bites 203 - add type hinting for returns
1 parent 7f229f1 commit 4d4dbf5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

203/type_hinting.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from dataclasses import dataclass
2-
3-
4-
@dataclass
1+
import typing
52
class Employee:
63
"""Simple Employee class
74
@@ -21,7 +18,7 @@ def __init__(self, first_name:str, last_name:str, days_per_week:int,
2118
self.hours_per_day = hours_per_day
2219
self.wage = wage
2320

24-
def _rounder(self, number:float, places:int):
21+
def _rounder(self, number:float, places:int) -> str:
2522
"""Rounds a number the specified number of places
2623
2724
:param number: Float of number of round
@@ -32,7 +29,7 @@ def _rounder(self, number:float, places:int):
3229
return f"${amount:0.2f}"
3330

3431
@property
35-
def weekly_pay(self):
32+
def weekly_pay(self) -> str:
3633
"""Returns amount of weekly pay in US currency
3734
3835
For instance: $250.75

0 commit comments

Comments
 (0)