Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diskcollections/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import collections
import collections.abc


class ISerializer:
Expand Down
5 changes: 2 additions & 3 deletions src/diskcollections/iterables/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Optional

from diskcollections.interfaces import IClientSequence
from diskcollections.py2to3 import TemporaryDirectory

mode_str = "w+"
mode_bytes = "w+b"
Expand All @@ -25,7 +24,7 @@ def __init__(self, iterable=(), mode=mode_bytes):
self.__mode = mode
self.__available_modes = modes - {mode}
self.__files = []
self.__directory = TemporaryDirectory()
self.__directory = tempfile.TemporaryDirectory()
self.extend(iterable)

def __repr__(self):
Expand Down Expand Up @@ -238,4 +237,4 @@ def safe_write(self, file_path, value):
except TypeError as e:
exc = e

raise exc
raise exc
19 changes: 9 additions & 10 deletions src/diskcollections/iterables/iterables.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import collections
import inspect
from collections.abc import MutableSequence
from functools import partial
from diskcollections.py2to3 import izip


class List(collections.abc.MutableSequence):
class List(MutableSequence):
def __init__(
self, iterable=None, client_class=None, serializer_class=None
):
Expand Down Expand Up @@ -76,7 +75,7 @@ def insert(self, index, value):
self.__client.insert(index, encoded_value)


class Deque(collections.abc.MutableSequence):
class Deque(MutableSequence):
def __init__(
self,
iterable=(),
Expand Down Expand Up @@ -124,7 +123,7 @@ def __eq__(self, other):
if len(self) != len(other):
return False

for i, j in izip(self, other):
for i, j in zip(self, other):
if i != j:
return False

Expand All @@ -134,14 +133,14 @@ def __ne__(self, other):
if len(self) != len(other):
return True

for i, j in izip(self, other):
for i, j in zip(self, other):
if i != j:
return True

return False

def __lt__(self, other):
for i, j in izip(self, other):
for i, j in zip(self, other):
if i >= j:
return False

Expand All @@ -151,7 +150,7 @@ def __lt__(self, other):
return True

def __le__(self, other):
for i, j in izip(self, other):
for i, j in zip(self, other):
if i > j:
return False

Expand All @@ -161,14 +160,14 @@ def __le__(self, other):
return True

def __gt__(self, other):
for i, j in izip(self, other):
for i, j in zip(self, other):
if i <= j:
return False

return True

def __ge__(self, other):
for i, j in izip(self, other):
for i, j in zip(self, other):
if i < j:
return False

Expand Down
26 changes: 0 additions & 26 deletions src/diskcollections/py2to3.py

This file was deleted.