projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add coding comments for files with utf8 characters in there.
[python_utils.git]
/
collect
/
shared_dict.py
diff --git
a/collect/shared_dict.py
b/collect/shared_dict.py
index ec76138b393955d47f3850bf2a91d425ada563b1..e0a42f2c55c2fc865b0c89642d458ae26009c224 100644
(file)
--- a/
collect/shared_dict.py
+++ b/
collect/shared_dict.py
@@
-31,16
+31,7
@@
import pickle
from contextlib import contextmanager
from functools import wraps
from multiprocessing import RLock, shared_memory
from contextlib import contextmanager
from functools import wraps
from multiprocessing import RLock, shared_memory
-from typing import (
- Any,
- Dict,
- Generator,
- ItemsView,
- Iterator,
- KeysView,
- Optional,
- ValuesView,
-)
+from typing import Any, Dict, Generator, ItemsView, Iterator, KeysView, Optional, ValuesView
from decorator_utils import synchronized
from decorator_utils import synchronized
@@
-94,9
+85,7
@@
class SharedDict(object):
return shared_memory.SharedMemory(name=name, create=True, size=size_bytes)
def _ensure_memory_initialization(self):
return shared_memory.SharedMemory(name=name, create=True, size=size_bytes)
def _ensure_memory_initialization(self):
- memory_is_empty = (
- bytes(self.shared_memory.buf).split(SharedDict.NULL_BYTE, 1)[0] == b''
- )
+ memory_is_empty = bytes(self.shared_memory.buf).split(SharedDict.NULL_BYTE, 1)[0] == b''
if memory_is_empty:
self.clear()
if memory_is_empty:
self.clear()