Skip to content

Commit 429f73c

Browse files
committed
threading: Add very bare implementation of Thread class.
1 parent da124ac commit 429f73c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

threading/threading.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import _thread
2+
3+
4+
class Thread:
5+
6+
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None):
7+
self.target = target
8+
self.args = args
9+
self.kwargs = {} if kwargs is None else kwargs
10+
11+
def start(self):
12+
_thread.start_new_thread(self.run, ())
13+
14+
def run(self):
15+
self.target(*self.args, **self.kwargs)

0 commit comments

Comments
 (0)