kopia lustrzana https://github.com/micropython/micropython-lib
collections: Remove micropython-lib Python implementation of deque.
It's no longer necessary since the built-in C version of this type now implements all the functionality here. Signed-off-by: Matt Trentini <matt.trentini@gmail.com>pull/848/head
rodzic
7206da4645
commit
a2e4efa09a
|
@ -1,36 +0,0 @@
|
||||||
class deque:
|
|
||||||
def __init__(self, iterable=None):
|
|
||||||
if iterable is None:
|
|
||||||
self.q = []
|
|
||||||
else:
|
|
||||||
self.q = list(iterable)
|
|
||||||
|
|
||||||
def popleft(self):
|
|
||||||
return self.q.pop(0)
|
|
||||||
|
|
||||||
def popright(self):
|
|
||||||
return self.q.pop()
|
|
||||||
|
|
||||||
def pop(self):
|
|
||||||
return self.q.pop()
|
|
||||||
|
|
||||||
def append(self, a):
|
|
||||||
self.q.append(a)
|
|
||||||
|
|
||||||
def appendleft(self, a):
|
|
||||||
self.q.insert(0, a)
|
|
||||||
|
|
||||||
def extend(self, a):
|
|
||||||
self.q.extend(a)
|
|
||||||
|
|
||||||
def __len__(self):
|
|
||||||
return len(self.q)
|
|
||||||
|
|
||||||
def __bool__(self):
|
|
||||||
return bool(self.q)
|
|
||||||
|
|
||||||
def __iter__(self):
|
|
||||||
yield from self.q
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "deque({})".format(self.q)
|
|
|
@ -1,4 +0,0 @@
|
||||||
metadata(version="0.1.3")
|
|
||||||
|
|
||||||
require("collections")
|
|
||||||
package("collections")
|
|
|
@ -6,10 +6,6 @@ try:
|
||||||
from .defaultdict import defaultdict
|
from .defaultdict import defaultdict
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
|
||||||
from .deque import deque
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class MutableMapping:
|
class MutableMapping:
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
metadata(version="0.1.2")
|
metadata(version="0.2.0")
|
||||||
|
|
||||||
package("collections")
|
package("collections")
|
||||||
|
|
Ładowanie…
Reference in New Issue