Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
9e8833e6
Commit
9e8833e6
authored
Oct 15, 2018
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix docstrings
parent
1971f1b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/gevent/greenlet.py
src/gevent/greenlet.py
+8
-7
No files found.
src/gevent/greenlet.py
View file @
9e8833e6
...
...
@@ -522,15 +522,15 @@ class Greenlet(greenlet):
self
.
_start_event
.
start
(
self
.
switch
)
@
staticmethod
def
add_spawn_callback
(
c
b
):
def
add_spawn_callback
(
c
allback
):
"""
add_spawn_callback(callback) -> None
Set up a *callback* to be invoked when :class:`Greenlet` objects
are started.
The invocation order of spawn callbacks is unspecified. Adding
on
e
callback more than one time will not cause it to be called more
The invocation order of spawn callbacks is unspecified. Adding
th
e
same
callback more than one time will not cause it to be called more
than once.
.. versionadded:: 1.3.8
...
...
@@ -538,21 +538,22 @@ class Greenlet(greenlet):
global
_spawn_callbacks
if
_spawn_callbacks
is
None
:
_spawn_callbacks
=
set
()
_spawn_callbacks
.
add
(
c
b
)
_spawn_callbacks
.
add
(
c
allback
)
@
staticmethod
def
remove_spawn_callback
(
c
b
):
def
remove_spawn_callback
(
c
allback
):
"""
remove_spawn_callback(callback) -> None
Remove *callback* function added with :meth:`Greenlet.add_spawn_callback`.
This function will not fail if *callback* has been already removed.
This function will not fail if *callback* has been already removed or
if *callback* was never added.
.. versionadded:: 1.3.8
"""
global
_spawn_callbacks
if
_spawn_callbacks
is
not
None
:
_spawn_callbacks
.
discard
(
c
b
)
_spawn_callbacks
.
discard
(
c
allback
)
if
not
_spawn_callbacks
:
_spawn_callbacks
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment