Try and make mypy happy about types
This commit is contained in:
parent
acbad39df7
commit
3d16e30aa8
|
@ -267,9 +267,13 @@ def find_markets_during_stay(
|
|||
"""Market events that happen during accommodation stays."""
|
||||
overlapping_markets = []
|
||||
for market in markets:
|
||||
market_date = market.as_date
|
||||
assert isinstance(market_date, date)
|
||||
for e in accommodation_events:
|
||||
start, end = e.as_date, e.end_as_date
|
||||
assert start and end and all(isinstance(i, date) for i in (start, end))
|
||||
# Check if the market date is within the accommodation dates.
|
||||
if e.as_date <= market.as_date <= e.end_as_date:
|
||||
if start <= market_date <= end:
|
||||
overlapping_markets.append(market)
|
||||
break # Breaks the inner loop if overlap is found.
|
||||
return overlapping_markets
|
||||
|
|
Loading…
Reference in a new issue