Skip to content

Commit 0e2f03e

Browse files
committed
fix exports
1 parent bf80051 commit 0e2f03e

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

posthog/__init__.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11
import datetime # noqa: F401
22
import warnings
3-
from typing import Callable, Dict, List, Optional, Tuple # noqa: F401
3+
from typing import Callable, Dict, Optional, Any # noqa: F401
44

55
from posthog.client import Client
66
from posthog.scopes import (
7-
new_context,
8-
scoped,
9-
tag,
10-
set_context_session,
11-
identify_context,
7+
new_context as inner_new_context,
8+
scoped as inner_scoped,
9+
tag as inner_tag,
10+
set_context_session as inner_set_context_session,
11+
identify_context as inner_identify_context,
1212
)
1313
from posthog.types import FeatureFlag, FlagsAndPayloads
1414
from posthog.version import VERSION
1515

1616
__version__ = VERSION
1717

1818
"""Context management."""
19-
new_context = new_context
20-
tag = tag
21-
scoped = scoped
22-
identify_context = identify_context
23-
set_context_session = set_context_session
19+
20+
21+
def new_context(fresh=False, capture_exceptions=True):
22+
return inner_new_context(fresh=fresh, capture_exceptions=capture_exceptions)
23+
24+
25+
def scoped(fresh=False, capture_exceptions=True):
26+
return inner_scoped(fresh=fresh, capture_exceptions=capture_exceptions)
27+
28+
29+
def set_context_session(session_id: str):
30+
return inner_set_context_session(session_id)
31+
32+
33+
def identify_context(distinct_id: str):
34+
return inner_identify_context(distinct_id)
35+
36+
37+
def tag(name: str, value: Any):
38+
return inner_tag(name, value)
2439

2540

2641
"""Settings."""

0 commit comments

Comments
 (0)