Skip to content

Commit d24904b

Browse files
committed
Apply Optional type hint
1 parent 9a8ef9b commit d24904b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pubsub/pubsub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
followers = defaultdict(set) # type: DefaultDict[User, Set[User]]
2727
user_info = dict() # type: Dict[User, UserInfo]
2828

29-
def post_message(user: User, text: str, timestamp: Timestamp=None) -> None:
29+
def post_message(user: User, text: str, timestamp: Optional[Timestamp]=None) -> None:
3030
user = intern(user)
3131
timestamp = timestamp or time()
3232
post = Post(timestamp, user, text)
@@ -61,7 +61,7 @@ def hash_password(user: User, password: str) -> bytes:
6161
combined = unicodedata.normalize('NFC', combined)
6262
return hashlib.pbkdf2_hmac('sha512', combined.encode('utf-8'), salt, 100000)
6363

64-
def set_user(user: User, displayname: str, email: str, password: str, bio=None, photo=None) -> None:
64+
def set_user(user: User, displayname: str, email: str, password: str, bio: Optional[str]=None, photo: Optional[str]=None) -> None:
6565
user = intern(user)
6666
hashed_password = hash_password(user, password)
6767
user_info[user] = UserInfo(displayname, email, hashed_password, bio, photo)

0 commit comments

Comments
 (0)