Pytanie
📝 **Zadanie:** Zbuduj mały estymator_pamięci (wiersze, bajty_wiersz, narzut_pct)\`, który zwraca całkowitą pamięć w MB (float, 2 miejsca po przecinku):
\`\`\`
total_bytes = wiersze * bajty_na_wiersz * (1 + narzut_pct / 100)
mb = total_bytes / 1_000_000 # dziesiętne MB — odpowiada konwencji Prometheus/Grafana
runda powrotna (mb, 2)
\`\`\`
Przetestuj 3 realistyczne skale: mała pamięć podręczna w pamięci, średniej wielkości ramka DataFrame pand, duży zbiór danych Redis.
📋 Zaimplementuj powyższą funkcję. Testy uruchamiają się automatycznie.
💡 **Wskazówka:** Jeśli utkniesz, przeczytaj ponownie teorię.
A Re-raising — wrapping a caught exception with `raise NewError() from e` loses the original traceback line numbers. B Bare `except: pass` — silently swallows everything including KeyboardInterrupt, SystemExit, and bugs you should fix. C Defining custom exception subclasses — every new exception type forces consumers to update their `except` tuples. D Catching at the boundary — handling errors in a middleware layer is too late for the caller to recover meaningfully.