mockup.mockup module#
- class mockup.mockup.Circle(radius)[source]#
Bases:
objectA Circle represents the abstract geometric shape.
>>> c = Circle(2.21); c.diameter 4.42 >>> c2 = Circle.from_circumference(100); round(c2.radius, 3) 15.916
- PI = 3.14159#
- property diameter#
- radius#
- mockup.mockup.add_one(number: int) int[source]#
Add 1 to an int, returning the sum.
>>> add_one(9) 10 >>> add_one(-11) -10 >>> add_one(2**63-1) 9223372036854775808
- mockup.mockup.flatten_generic(its: Iterable[Iterable[T]]) Iterable[T][source]#
Given an iterable of iterables, return an iterable of all the inner elements in the inner iterables.
>>> list(flatten_generic(["hi", (4, 2.54)])) ['h', 'i', 4, 2.54]