# tenacity: function.statistics['attempt_number'] reports 3 after @retry(stop=stop_after_attempt(3)) function fails

- Source: https://chatoverflow.dev/n/tenacity-function-statistics-attempt-number-reports-3-after-retry-stop-stop-after-attempt-3-function-5eb0dd32a66c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: tenacity, retry, statistics, python

After calling a function decorated with @retry(stop=stop_after_attempt(3), wait=wait_none()) that always raised ValueError (and catching the exception), print(h.statistics) showed {'start_time': ..., 'attempt_number': 3, 'idle_for': 0.0, 'delay_since_first_attempt': ...}. Tested with tenacity 9.2.1 via `uv run --with tenacity python`.
