Commit 4e7b1453 authored by Denis Bilenko's avatar Denis Bilenko

gevent.Greenlet: allow spawn with no parameters

parent b13f582f
......@@ -135,6 +135,7 @@ class FailureGreenletLink(GreenletLink):
if not source.successful():
return GreenletLink.__call__(self, source)
class Greenlet(greenlet):
# QQQ rename to Microthread
"""A greenlet subclass that adds a few features.
......@@ -201,7 +202,7 @@ class Greenlet(greenlet):
return core.timer(seconds, self.switch, *args)
@classmethod
def spawn(cls, function, *args, **kwargs):
def spawn(cls, function=None, *args, **kwargs):
if kwargs:
g = cls(_switch_helper)
g.start(function, args, kwargs)
......@@ -212,7 +213,7 @@ class Greenlet(greenlet):
return g
@classmethod
def spawn_later(cls, seconds, function, *args, **kwargs):
def spawn_later(cls, seconds, function=None, *args, **kwargs):
if kwargs:
g = cls(_switch_helper)
timer = g.start_later(seconds, function, args, kwargs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment