Should type hints and documentation for them be unified?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/metaperl/pymt5adapter/blob/master/pymt5adapter/order.py#L104 | |
def __init__(self, | |
request: dict = None, *, action: int = None, magic: int = None, | |
order: int = None, symbol=None, volume: float = None, | |
price: float = None, stoplimit: float = None, sl: float = None, tp: float = None, | |
deviation: int = None, type: int = None, type_filling: int = None, type_time: int = None, | |
expiration: int = None, comment: str = None, position: int = None, position_by: int = None, | |
**kwargs | |
): | |
# BECOMES | |
def __init__(self, | |
request: dict = None # a request instance, | |
*, | |
action: int = None # the action to take, | |
magic: int = None # Magic number, | |
order: int = None # type of order, | |
symbol=None # symbol to trade, | |
volume: float = None # number of lots to trade | |
) | |
# And it is automatically turned into documentation for Sphinx. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment