Answers for "call docstring python"

2

python multiline docstring styles

class Vehicle(object):
    '''
    The Vehicle object contains lots of vehicles
    :param arg: The arg is used for ...
    :type arg: str
    :param `*args`: The variable arguments are used for ...
    :param `**kwargs`: The keyword arguments are used for ...
    :ivar arg: This is where we store arg
    :vartype arg: str
    '''


    def __init__(self, arg, *args, **kwargs):
        self.arg = arg

    def cars(self, distance, destination):
        '''We can't travel a certain distance in vehicles without fuels, so here's the fuels

        :param distance: The amount of distance traveled
        :type amount: int
        :param bool destinationReached: Should the fuels be refilled to cover required distance?
        :raises: :class:`RuntimeError`: Out of fuel

        :returns: A Car mileage
        :rtype: Cars
        '''  
        pass
Posted by: Guest on September-08-2020
1

python docstring

def complex(real=0.0, imag=0.0):
    """Form a complex number

    Args:
        real (float, optional): The real part. Defaults to 0.0.
        imag (float, optional): The imaginary part. Defaults to 0.0.
    """ 
    if imag == 0.0 and real == 0.0:
        return complex_zero
    ...
Posted by: Guest on June-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language