Skip to content

Commit

Permalink
updates typing
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzsnz committed Sep 9, 2024
1 parent bf8d03d commit be72c5a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ib_fundamental/fundamental.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,22 @@ def ratios(self) -> RatioSnapshot:
return self.__ratios

@property
def fundamental_ratios(self) -> FundamentalRatios:
def fundamental_ratios(self) -> FundamentalRatios | None:
try:
return self.__fundamental_ratios
except AttributeError:
self.__fundamental_ratios: FundamentalRatios = self.client.get_ratios()
self.__fundamental_ratios: FundamentalRatios | None = (
self.client.get_ratios()
)
self.ticker = self.client.ib.ticker(self.contract)
return self.__fundamental_ratios

@property
def dividend_summary(self) -> Dividends:
def dividend_summary(self) -> Dividends | None:
try:
return self.__dividend_summary
except AttributeError:
self.__dividend_summary: Dividends = self.client.get_dividends()
self.__dividend_summary: Dividends | None = self.client.get_dividends()
self.ticker = self.client.ib.ticker(self.contract)
return self.__dividend_summary

Expand Down

0 comments on commit be72c5a

Please sign in to comment.