functionalthreading 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/PKG-INFO +1 -1
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading/__init__.py +2 -1
- functionalthreading-0.4.0/functionalthreading/classes/__init__.py +15 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading/functions/__init__.py +2 -12
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/PKG-INFO +1 -1
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/SOURCES.txt +1 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/pyproject.toml +1 -1
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/setup.py +5 -1
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/LICENSE +0 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/README.md +0 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/dependency_links.txt +0 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/top_level.txt +0 -0
- {functionalthreading-0.3.0 → functionalthreading-0.4.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: functionalthreading
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Functional programming with thread-based parallelism
|
|
5
5
|
Author-email: Richard Tong <richytong@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/richytong/functionalthreading
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from functools import partial, Placeholder as _
|
|
2
2
|
from functionalthreading.functions import chain, tap, tmap
|
|
3
|
+
from functionalthreading.classes import Thread
|
|
3
4
|
|
|
4
5
|
__name__ = 'functionalthreading'
|
|
5
6
|
|
|
6
|
-
__all__ = ['partial', '_' ,'chain', 'tap', 'tmap']
|
|
7
|
+
__all__ = ['Thread', 'partial', '_' ,'chain', 'tap', 'tmap']
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from threading import Thread as _Thread
|
|
2
|
+
|
|
3
|
+
class Thread(_Thread):
|
|
4
|
+
def __init__(self, *args, **kwargs):
|
|
5
|
+
_Thread.__init__(self, *args, **kwargs)
|
|
6
|
+
self.value = None
|
|
7
|
+
self.target = kwargs['target']
|
|
8
|
+
self.args = kwargs['args']
|
|
9
|
+
|
|
10
|
+
def run(self):
|
|
11
|
+
self.value = self.target(*self.args)
|
|
12
|
+
|
|
13
|
+
__name__ = 'classes'
|
|
14
|
+
|
|
15
|
+
__all__ = ['Thread']
|
{functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading/functions/__init__.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from functools import partial, Placeholder as _
|
|
2
|
-
from
|
|
2
|
+
from functionalthreading.classes import Thread
|
|
3
3
|
|
|
4
4
|
def _chain(argument, funcs):
|
|
5
5
|
ret = argument
|
|
@@ -61,23 +61,13 @@ def tap(func):
|
|
|
61
61
|
return argument
|
|
62
62
|
return inner_func
|
|
63
63
|
|
|
64
|
-
class _Thread(Thread):
|
|
65
|
-
def __init__(self, *args, **kwargs):
|
|
66
|
-
Thread.__init__(self, *args, **kwargs)
|
|
67
|
-
self.value = None
|
|
68
|
-
self.target = kwargs['target']
|
|
69
|
-
self.args = kwargs['args']
|
|
70
|
-
|
|
71
|
-
def run(self):
|
|
72
|
-
self.value = self.target(*self.args)
|
|
73
|
-
|
|
74
64
|
def _tmap(array_or_tuple, func):
|
|
75
65
|
length = len(array_or_tuple)
|
|
76
66
|
threads = []
|
|
77
67
|
index = 0
|
|
78
68
|
args = [array_or_tuple]
|
|
79
69
|
while index < length:
|
|
80
|
-
t =
|
|
70
|
+
t = Thread(target=func, args=[array_or_tuple[index]])
|
|
81
71
|
t.start()
|
|
82
72
|
threads.append(t)
|
|
83
73
|
index += 1
|
{functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: functionalthreading
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Functional programming with thread-based parallelism
|
|
5
5
|
Author-email: Richard Tong <richytong@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/richytong/functionalthreading
|
|
@@ -8,5 +8,9 @@ with open('pyproject.toml', 'rb') as file:
|
|
|
8
8
|
name='functionalthreading',
|
|
9
9
|
version=pyproject['project']['version'],
|
|
10
10
|
description='Functional programming with thread-based parallelism',
|
|
11
|
-
packages=[
|
|
11
|
+
packages=[
|
|
12
|
+
'functionalthreading',
|
|
13
|
+
'functionalthreading.classes',
|
|
14
|
+
'functionalthreading.functions',
|
|
15
|
+
],
|
|
12
16
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{functionalthreading-0.3.0 → functionalthreading-0.4.0}/functionalthreading.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|