MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / Namespace

Class Namespace

code2flow/model.py:12–23  ·  view source on GitHub ↗

Abstract constants class Constants can be accessed via .attribute or [key] and can be iterated over.

Source from the content-addressed store, hash-verified

10
11
12class Namespace(dict):
13 """
14 Abstract constants class
15 Constants can be accessed via .attribute or [key] and can be iterated over.
16 """
17 def __init__(self, *args, **kwargs):
18 d = {k: k for k in args}
19 d.update(dict(kwargs.items()))
20 super().__init__(d)
21
22 def __getattr__(self, item):
23 return self[item]
24
25
26OWNER_CONST = Namespace("UNKNOWN_VAR", "UNKNOWN_MODULE")

Callers 1

model.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected