Skip to content

Commit

Permalink
use immutable dataclass with eq instead of overriding hash method for…
Browse files Browse the repository at this point in the history
… Asset
  • Loading branch information
phelps-sg committed Oct 10, 2023
1 parent 0b8535b commit bc6dc5e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions zipline_tardis_bundle/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,12 @@

import pandas as pd
from tardis_dev import get_exchange_details
from typing_extensions import override


@dataclass
@dataclass(frozen=True, eq=True)
class Asset:
symbol: str

@override
def __hash__(self) -> int:
return self.symbol.__hash__()


@lru_cache
def exchange_details_cached(exchange: str) -> Dict[Any, Any]:
Expand Down

0 comments on commit bc6dc5e

Please sign in to comment.