summaryrefslogtreecommitdiff
path: root/queue.py
diff options
context:
space:
mode:
authorroot <root@turin.home>2022-01-16 13:40:19 +0000
committerroot <root@turin.home>2022-01-16 13:40:19 +0000
commitbefb917ec5cbcbb0aaae33c53e6c0b2c4b92afcf (patch)
treec2bcffbd5a831d376218f7b2e92cc4b382e0a43b /queue.py
parent7104802fedc605cb386339733a6162e10da2aabd (diff)
Avoid naming conflict with queue library
Diffstat (limited to 'queue.py')
-rw-r--r--queue.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/queue.py b/queue.py
deleted file mode 100644
index 85516cf..0000000
--- a/queue.py
+++ /dev/null
@@ -1,19 +0,0 @@
-class circular_queue:
- def __init__(self,size):
- self.size = size
- self.queue = []
- for i in range(self.size):
- self.queue.append(None)
- self.pointer = 0
- def add(self, value):
- self.queue[self.pointer] = value
- self.pointer += 1
- if self.pointer > 49:
- self.pointer = 0
- def average(self):
- queue = self.queue
- while None in queue:
- queue.remove(None)
- if len(queue) == 0:
- return 0
- return sum(queue) / len(queue)