============================================================
 CONTEXT MANAGERS — CUSTOM RESOURCE HANDLER - Demo Run
============================================================

--- Class-based Timer context manager ---
    [Timer] Elapsed: 20.161ms

--- ManagedResource: normal flow ---
    [ManagedResource] Opened
    (doing work inside the block)
    [ManagedResource] Closed

--- ManagedResource: exception still triggers cleanup ---
    [ManagedResource] Opened
    [ManagedResource] Closed
    [ManagedResource] An exception occurred: RuntimeError: Something went wrong inside the block
  Confirmed: exception propagated AFTER __exit__ ran (resource still 'closed').

--- Exception suppression: only ValueError ---
    [SuppressSpecific] Suppressing ValueError: This will be suppressed
  Program continued normally after the suppressed ValueError.
  Confirmed: TypeError correctly propagated (not suppressed).

--- @contextmanager decorator style (vs. class-based) ---
    [timer_contextmanager] Elapsed: 10.118ms
  Same timing behavior as the class-based Timer, less boilerplate.

--- Combining Timer with real work ---
    [Timer] Elapsed: 4.137ms
  Computed sum of squares: 333328333350000

============================================================
 Assignment: suppress_and_log(*exception_types)
============================================================
    [suppress_and_log] Suppressed ValueError: Bad value
  Continued after suppressed ValueError.
    [suppress_and_log] Suppressed KeyError: 'missing_key'
  Continued after suppressed KeyError.
  Confirmed: TypeError (not in the suppress list) correctly propagated.
