Skip to content

Commit 5df3b55

Browse files
authored
Merge pull request #95 from launchdarkly/eb/ch17280/edits
misc. doc comment edits
2 parents 794e59f + 74e82c8 commit 5df3b55

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

ldclient/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def set_config(config):
3232
re-initialized with the new configuration (this will result in the next call to :func:`ldclient.get()`
3333
returning a new client instance).
3434
35-
:param string sdk_key: the new SDK key
35+
:param ldclient.config.Config config: the client configuration
3636
"""
3737
global __config
3838
global __client
@@ -93,7 +93,7 @@ def get():
9393
"""Returns the shared SDK client instance, using the current global configuration.
9494
9595
To use the SDK as a singleton, first make sure you have called :func:`ldclient.set_sdk_key()` or
96-
:func:`ldclient.set_config()` at startup time. Then `get()` will return the same shared
96+
:func:`ldclient.set_config()` at startup time. Then ``get()`` will return the same shared
9797
:class:`ldclient.client.LDClient` instance each time. The client will be initialized if it has
9898
not been already.
9999

ldclient/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ class LDClient(object):
7171
def __init__(self, sdk_key=None, config=None, start_wait=5):
7272
"""Constructs a new LDClient instance.
7373
74-
Rather than calling this constructor directly, you can call the `ldclient.set_sdk_key`,
75-
`ldclient.set_config`, and `ldclient.get` functions to configure and use a singleton
76-
client instance.
77-
7874
:param string sdk_key: the SDK key for your LaunchDarkly environment
7975
:param ldclient.config.Config config: optional custom configuration
8076
:param float start_wait: the number of seconds to wait for a successful connection to LaunchDarkly
@@ -203,7 +199,7 @@ def is_offline(self):
203199
def is_initialized(self):
204200
"""Returns true if the client has successfully connected to LaunchDarkly.
205201
206-
:rype: bool
202+
:rtype: bool
207203
"""
208204
return self.is_offline() or self._config.use_ldd or self._update_processor.initialized()
209205

ldclient/config.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ def copy_with_new_sdk_key(self, new_sdk_key):
166166
user_keys_flush_interval=self.__user_keys_flush_interval,
167167
inline_users_in_events=self.__inline_users_in_events)
168168

169+
# for internal use only - probably should be part of the client logic
169170
def get_default(self, key, default):
170-
"""Used internally by the SDK client to get the default value for a flag.
171-
"""
172171
return default if key not in self.__defaults else self.__defaults[key]
173172

174173
@property
@@ -179,22 +178,22 @@ def sdk_key(self):
179178
def base_uri(self):
180179
return self.__base_uri
181180

181+
# for internal use only - also no longer used, will remove
182182
@property
183183
def get_latest_flags_uri(self):
184-
"""Used internally, deprecated.
185-
186-
.. deprecated:: 5.0.0
187-
"""
188184
return self.__base_uri + GET_LATEST_FEATURES_PATH
189185

186+
# for internal use only - should construct the URL path in the events code, not here
190187
@property
191188
def events_uri(self):
192189
return self.__events_uri + '/bulk'
193190

191+
# for internal use only
194192
@property
195193
def stream_base_uri(self):
196194
return self.__stream_uri
197195

196+
# for internal use only - should construct the URL path in the streaming code, not here
198197
@property
199198
def stream_uri(self):
200199
return self.__stream_uri + STREAM_FLAGS_PATH

ldclient/flag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def variation_index(self):
4545
"""The index of the returned value within the flag's list of variations, e.g.
4646
0 for the first variation -- or None if the default value was returned.
4747
48-
:rtype: int
48+
:rtype: int or None
4949
"""
5050
return self.__variation_index
5151

ldclient/flags_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_flag_reason(self, key):
6363
:param string key: the feature flag key
6464
:return: a dictionary describing the reason; None if reasons were not recorded, or if there was no
6565
such flag
66-
:rtype: dict
66+
:rtype: dict or None
6767
"""
6868
meta = self.__flag_metadata.get(key)
6969
return None if meta is None else meta.get('reason')

0 commit comments

Comments
 (0)