Typecheck improvements

This commit is contained in:
xmatthias
2018-06-02 13:43:51 +02:00
parent e28973c50a
commit 4a322abd4d
3 changed files with 9 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
This module contains class to define a RPC communications
"""
import logging
from datetime import datetime, timedelta
from datetime import datetime, timedelta, date
from decimal import Decimal
from typing import Dict, Tuple, Any, Optional
@@ -114,7 +114,7 @@ class RPC(object):
self, timescale: int,
stake_currency: str, fiat_display_currency: str) -> Tuple[bool, Any]:
today = datetime.utcnow().date()
profit_days: Dict[int, Dict] = {}
profit_days: Dict[date, Dict] = {}
if not (isinstance(timescale, int) and timescale > 0):
return True, '*Daily [n]:* `must be an integer greater than 0`'
@@ -172,7 +172,7 @@ class RPC(object):
durations = []
for trade in trades:
current_rate: Optional[float] = None
current_rate: float = 0.0
if not trade.open_rate:
continue