Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def somefunc(param1: "string annotation",
- param2: 151631,
- param3: any_object): -> "some information here":
- print (somefunc.func_annotations)
- {'param1': "string annotation",
- 'param2': 151631,
- 'param3': <object any_object>,
- 'return': "some information here"}
- def x_intercept(m, b):
- """
- Return the x intercept of the line M{y=m*x+b}. The X{x intercept}
- of a line is the point at which it crosses the x axis (M{y=0}).
- This function can be used in conjuction with L{z_transform} to
- find an arbitrary function's zeros.
- @type m: number
- @param m: The slope of the line.
- @type b: number
- @param b: The y intercept of the line. The X{y intercept} of a
- line is the point at which it crosses the y axis (M{x=0}).
- @rtype: number
- @return: the x intercept of the line M{y=m*x+b}.
- """
- return -b/m
- def someFunction( arg1, arg2 ):
- """Returns the average of *two* (and only two) arguments.
- :param arg1: a numeric value
- :type arg1: **any** numeric type
- :param arg2: another numeric value
- :type arg2: **any** numeric type
- :return: mid-point (or arithmetic mean) between two values
- :rtype: numeric type compatible with the args.
- """
- return (arg1+arg2)/2
Add Comment
Please, Sign In to add comment