From 8e9aec57f3f55a0b4a20d2f7b3c0777e0fef9c96 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 17 Nov 2026 15:51:01 -0500 Subject: [PATCH 1/2] docs: point the new_context contexts link at the SDK reference The hand-written /docs/libraries/python page is retired, so its #contexts anchor no longer exists. Link to the posthog.new_context reference entry, which the Flask and Django docs already use. Co-Authored-By: Claude Opus 5.5 --- posthog/client.py | 2 +- references/posthog-python-7.md | 2 +- references/posthog-python-8.md | 2 +- references/posthog-python-reference.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/posthog/client.py b/posthog/client.py index d71aa13d7..82051dc38 100644 --- a/posthog/client.py +++ b/posthog/client.py @@ -1923,7 +1923,7 @@ def _set_before_send(self, before_send): def new_context(self, fresh=False, capture_exceptions: Optional[bool] = None): """ - Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts). + Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). Args: fresh: Whether to create a fresh context that doesn't inherit from parent. diff --git a/references/posthog-python-7.md b/references/posthog-python-7.md index a9ed00bd7..b00fbd36b 100644 --- a/references/posthog-python-7.md +++ b/references/posthog-python-7.md @@ -963,7 +963,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). **Parameters:** diff --git a/references/posthog-python-8.md b/references/posthog-python-8.md index a7d441aa7..4ab13a991 100644 --- a/references/posthog-python-8.md +++ b/references/posthog-python-8.md @@ -1001,7 +1001,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). **Parameters:** diff --git a/references/posthog-python-reference.md b/references/posthog-python-reference.md index acd91e295..b62c683aa 100644 --- a/references/posthog-python-reference.md +++ b/references/posthog-python-reference.md @@ -1001,7 +1001,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). **Parameters:** From 86654230740017ac3b8db5145f4fc658d236d510 Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 17 Nov 2026 16:03:12 -0500 Subject: [PATCH 2/2] docs: link contexts through the Python SDK page path Co-Authored-By: Claude Opus 5.5 --- posthog/client.py | 2 +- references/posthog-python-7.md | 2 +- references/posthog-python-8.md | 2 +- references/posthog-python-reference.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/posthog/client.py b/posthog/client.py index 82051dc38..7d2c36709 100644 --- a/posthog/client.py +++ b/posthog/client.py @@ -1923,7 +1923,7 @@ def _set_before_send(self, before_send): def new_context(self, fresh=False, capture_exceptions: Optional[bool] = None): """ - Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). + Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#posthognew_context). Args: fresh: Whether to create a fresh context that doesn't inherit from parent. diff --git a/references/posthog-python-7.md b/references/posthog-python-7.md index b00fbd36b..ad00201e3 100644 --- a/references/posthog-python-7.md +++ b/references/posthog-python-7.md @@ -963,7 +963,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#posthognew_context). **Parameters:** diff --git a/references/posthog-python-8.md b/references/posthog-python-8.md index 4ab13a991..51c14b8c0 100644 --- a/references/posthog-python-8.md +++ b/references/posthog-python-8.md @@ -1001,7 +1001,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#posthognew_context). **Parameters:** diff --git a/references/posthog-python-reference.md b/references/posthog-python-reference.md index b62c683aa..86d45b56d 100644 --- a/references/posthog-python-reference.md +++ b/references/posthog-python-reference.md @@ -1001,7 +1001,7 @@ Flat list of the lanes' consumers, analytics first (kept for backwards compatibi new_context(fresh=False, capture_exceptions: Optional[bool] = None) ``` -Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python/reference#posthognew_context). +Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#posthognew_context). **Parameters:**