Skip to content

Commit ea23756

Browse files
committed
CI fixes
fix docstring for good, use comment style annotations where needed to support python<=3.4
1 parent 90daacd commit ea23756

File tree

1 file changed

+6
-4
lines changed
  • opentelemetry-api/src/opentelemetry/configuration

1 file changed

+6
-4
lines changed

opentelemetry-api/src/opentelemetry/configuration/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,15 @@
9999

100100

101101
class Configuration:
102-
_instance: Optional["Configuration"] = None
103-
_config_map: Dict[str, ConfigValue]
102+
_instance = None # type: Optional["Configuration"]
103+
_config_map = {} # type: Dict[str, ConfigValue]
104104

105105
def __new__(cls) -> "Configuration":
106106
if cls._instance is not None:
107107
instance = cls._instance
108108
else:
109109

110110
instance = super().__new__(cls)
111-
instance._config_map = {}
112111
for key, value_str in environ.items():
113112

114113
match = fullmatch(
@@ -150,7 +149,10 @@ def __setattr__(self, key: str, val: ConfigValue) -> None:
150149
raise AttributeError(key)
151150

152151
def get(self, name: str, default: _T) -> _T:
153-
"""Use this typed method for dynamic access instead of `getattr`"""
152+
"""Use this typed method for dynamic access instead of `getattr`
153+
154+
:rtype: str or bool or int or float or None
155+
"""
154156
val = self._config_map.get(name, default)
155157
return val
156158

0 commit comments

Comments
 (0)