harbor: Harbor = Harbor([[] for _ in range(N_STACKS)]) for line in bottomup: tokens = [ ''.join(x for _, x in g[1]) for g in groupby( enumerate(line), lambda t: t[0] // N_CHARS_IN_BOX_TOKEN ) ] boxes: List[Box] = [t.strip('[] ') for t in tokens] for box, stack in zip(boxes, harbor.iter_stacks()): if box: stack.append(box) return harbor
of your program, that interacts with the "outside world". Once it's inside, organize it into nice data structures so that operations (i.e. code) are as self evident as possible.” — Matthew Drury
the user? what is a good standard? (e.g., JSON:API) Database schema how to store data e ff ectively? how to normalize? → storage vs performance Domain model how to solve business requirement?
the user? what is a good standard? (e.g., JSON:API) Database schema how to store data e ff ectively? how to normalize? → storage vs performance Domain model how to solve business requirement?
the user? what is a good standard? (e.g., JSON:API) Database schema how to store data e ff ectively? how to normalize? → storage vs performance Domain model how to solve business requirement?
due_on: date class PaidInvoice: customer: CustomerID amount: Decimal paid_on: date class OverdueInvoice: customer: CustomerID amount: Decimal overdue_by: int reminder_level: int
due_on: date class PaidInvoice: customer: CustomerID amount: Decimal paid_on: date class OverdueInvoice: customer: CustomerID amount: Decimal overdue_by: int reminder_level: int def release_the_hounds( invs: list[OverdueInvoice] ) -> list[CustomerID]: ...
layers of a project—e.g. ORM, API schema, and business logic. Types need to be easy to change and reason about so we can adapt them to our evolving requirements. Types near the edge (like API schemas and database tables) are inherently less f lexible. It's often better to explicitly map types between these layers rather than create a "franken-type" and allow the least f lexible layer to calcify the rest.” — Adam Montgomery