Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from decimal import Decimal
- from typing import Union
- class Coin:
- """
- Custom coin data structure class that holds coin data and allows set access for each variable from outside functions
- Arguments:
- - arg: type, description
- # ...
- """
- bsc_url: str
- eth_url: str
- tracker_url: str
- coin_type: str
- contract: Union[str, object]
- quantity: Decimal
- # ...
- # You SHOULD be explicit
- def __init__(self, bs_url, eth_url, coin_type, contract, quantity):
- self.bs_url = "https://charts.bogged.finance/?token="
- self.eth_url = "https://www.dextools.io/app/uniswap/pair-explorer/"
- self.tracker_url = quanity
- self.coin_type = coin_type
- self.contract = contract
- self.quantity = quantity
- # But it allowed to use kwargs
- def __init__(self, **kwargs):
- self.bs_url = "https://charts.bogged.finance/?token="
- self.eth_url = "https://www.dextools.io/app/uniswap/pair-explorer/"
- self.tracker_url = kwargs.get("tracker_url")
- self.coin_type = kwargs.get("coin_type")
- self.contract = kwargs.get("contract")
- self.quantity = kwargs.get("quantity")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement