Skip to content

Commit

Permalink
threading: Add very bare implementation of Thread class.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalcon committed Oct 31, 2017
1 parent da124ac commit 429f73c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions threading/threading.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import _thread


class Thread:

def __init__(self, group=None, target=None, name=None, args=(), kwargs=None):
self.target = target
self.args = args
self.kwargs = {} if kwargs is None else kwargs

def start(self):
_thread.start_new_thread(self.run, ())

def run(self):
self.target(*self.args, **self.kwargs)

0 comments on commit 429f73c

Please sign in to comment.