Tinkoff / invest-python

Tinkoff Invest Python gRPC client
https://tinkoff.github.io/invest-python/
Apache License 2.0
303 stars 88 forks source link

feat: allow MoneyValue type for quotation_to_decimal #180

Closed neostimul closed 1 year ago

WISEPLAT commented 1 year ago

hi! Why this wasn't approved?

WISEPLAT commented 1 year ago

I think you should use Union:

from typing import Union

def quotation_to_decimal(quotation: Union[Quotation, MoneyValue]) -> Decimal: fractional = quotation.nano / Decimal("10e8") return Decimal(quotation.units) + fractional

daxartio commented 1 year ago

Там линтер ругается на длину строки

neostimul commented 1 year ago

Похоже на то