Repository navigation
docs: add docstrings to ExceptionCapture public methods - #1257
Conversation
Add class-level docstring and per-method docstrings to ExceptionCapture, covering __init__, close, exception_handler, thread_exception_handler, exception_receiver, and capture_exception. No behaviour changes — documentation only. Signed-off-by: mi-vault <asmisharma2026@gmail.com>
marandaneto
left a comment
There was a problem hiding this comment.
Agent-drafted and reviewed by Manoel.
Signed-off-by: mi-vault <asmisharma2026@gmail.com>
marandaneto
left a comment
There was a problem hiding this comment.
Agent-drafted and reviewed by Manoel.
Thanks for addressing the feedback. The bucket_size docstring now describes it as token capacity, and the exception_receiver docstring no longer claims the Django/Flask integrations use it. LGTM.
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
Motivation and Context
ExceptionCaptureis the class responsible for installing and managing process-widesys.excepthookandthreading.excepthookhandlers that forward uncaught exceptions to PostHog. Its public methods (__init__,close,exception_handler,thread_exception_handler,exception_receiver, andcapture_exception) had no docstrings, making it harder for contributors and integrators to understand the intent, parameters, and behaviour of each method without reading through the implementation.This PR adds:
ExceptionCapturedoes and its two optional features (hook chaining and rate limiting)__init__docstring covering all five parameters with their clamping constraints and defaultsclose,exception_handler,thread_exception_handler,exception_receiver, andcapture_exceptionNo behaviour changes; documentation only.
How did you test it?
Existing test suite (
pytest --verbose --timeout=30) passes without modification. No new tests are needed as this is a documentation-only change.Verified with:
ruff format --check .(clean)ruff check .(clean)Checklist
Agent Context