Skip to content

Commit

Permalink
Add type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeDongGeon1996 committed Aug 15, 2024
1 parent ea0861d commit c2573c7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions stock_indicators/indicators/common/quote.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from datetime import datetime
from decimal import Decimal
from numbers import Number
from typing import Iterable, Optional
from typing import Any, Iterable, Optional

from stock_indicators._cslib import CsQuote
from stock_indicators._cslib import CsQuoteUtility
from stock_indicators._cslib import CsQuote, CsQuoteUtility
from stock_indicators._cstypes import List as CsList
from stock_indicators._cstypes import DateTime as CsDateTime
from stock_indicators._cstypes import Decimal as CsDecimal
from stock_indicators._cstypes.datetime import to_pydatetime
from stock_indicators._cstypes.decimal import to_pydecimal
from stock_indicators._cstypes import to_pydatetime, to_pydecimal
from stock_indicators.indicators.common.enums import CandlePart
from stock_indicators.indicators.common._contrib.type_resolver import generate_cs_inherited_class

Expand Down Expand Up @@ -58,9 +55,9 @@ class _Quote:
close = property(_get_close, _set_close)
volume = property(_get_volume, _set_volume)

def __init__(self, date: datetime, open: Optional[Number] = None,
high: Optional[Number] = None, low: Optional[Number] = None,
close: Optional[Number] = None, volume: Optional[Number] = None):
def __init__(self, date: datetime, open: Optional[Any] = None,

Check warning on line 58 in stock_indicators/indicators/common/quote.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

stock_indicators/indicators/common/quote.py#L58

Redefining built-in 'open'
high: Optional[Any] = None, low: Optional[Any] = None,
close: Optional[Any] = None, volume: Optional[Any] = None):
self.date = date
self.open: Decimal = open if open else 0
self.high: Decimal = high if high else 0
Expand Down

0 comments on commit c2573c7

Please sign in to comment.