added package structure
This commit is contained in:
25
bstrd/bsvar.py
Normal file
25
bstrd/bsvar.py
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
class BSVar:
|
||||
|
||||
def __init__(self, name, cache):
|
||||
self.name = name
|
||||
self.cache = cache
|
||||
|
||||
def get(self):
|
||||
return self.cache.data.get(self.name)
|
||||
|
||||
value = property(get)
|
||||
|
||||
def __repr__(self):
|
||||
return f"{self.name} = {self.value}"
|
||||
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def __next__(self):
|
||||
next(self.cache)
|
||||
return self.get()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user