From 745caf911a0e6b8019efae0a63ea7f489228848c Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 19 Dec 2021 19:08:09 +0530 Subject: [PATCH] perf: specify slots on FIFO queue --- erpnext/stock/valuation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/valuation.py b/erpnext/stock/valuation.py index 7f54facda8b..48efde64d24 100644 --- a/erpnext/stock/valuation.py +++ b/erpnext/stock/valuation.py @@ -20,6 +20,10 @@ class FifoValuation: ref: https://en.wikipedia.org/wiki/FIFO_and_LIFO_accounting """ + # specifying the attributes to save resources + # ref: https://docs.python.org/3/reference/datamodel.html#slots + __slots__ = ["queue",] + def __init__(self, state: Optional[List[FifoBin]]): self.queue: List[FifoBin] = state if state is not None else []