Skip to content

Commit

Permalink
Merge pull request #1195 from PokestarFan/add-types-trophy
Browse files Browse the repository at this point in the history
(#1164) Add types to trophy.py
  • Loading branch information
bboe committed Dec 29, 2019
2 parents 999ad1e + 92a410c commit 54422f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions praw/models/trophy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"""Represent the Trophy class."""
from typing import Any, Dict, TypeVar

from .base import PRAWBase

Reddit = TypeVar("Reddit")


class Trophy(PRAWBase):
"""Represent a trophy.
Expand Down Expand Up @@ -30,7 +34,7 @@ class Trophy(PRAWBase):
======================= ===================================================
"""

def __init__(self, reddit, _data):
def __init__(self, reddit: Reddit, _data: Dict[str, Any]):
"""Initialize a Trophy instance.
:param reddit: An instance of :class:`.Reddit`.
Expand All @@ -41,6 +45,6 @@ def __init__(self, reddit, _data):
assert isinstance(_data, dict) and "name" in _data
super().__init__(reddit, _data=_data)

def __str__(self):
def __str__(self) -> str:
"""Return a name of the trophy."""
return self.name # pylint: disable=no-member

0 comments on commit 54422f7

Please sign in to comment.