-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-34344 Fixed AbstractEventLoopPolicy.get_event_loop docstrings #16463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @idomic, and welcome to CPython!
This change looks good, but I think it was made in the wrong place. This new docstring should be moved to the get_event_loop
method on line 632 of this same file. The current docstring for line 580 is perfectly fine as-is.
Besides that, I've got a couple of formatting fixes that should be incorporated. See below:
Lib/asyncio/events.py
Outdated
current context and the current policy does not specify to create one. | ||
|
||
It should never return None.""" | ||
""" Get the event loop for the current context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No leading space here:
""" Get the event loop for the current context. | |
"""Get the event loop for the current context. |
Lib/asyncio/events.py
Outdated
|
||
It should never return None.""" | ||
""" Get the event loop for the current context. | ||
Returns an instance of EventLoop or raises an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hanging indent here:
Returns an instance of EventLoop or raises an exception. | |
Returns an instance of EventLoop or raises an exception. |
Lib/asyncio/events.py
Outdated
It should never return None.""" | ||
""" Get the event loop for the current context. | ||
Returns an instance of EventLoop or raises an exception. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad indent here:
""" | |
""" |
Thanks @brandtbucher for the warm welcome and the detailed comments. |
Accepted change Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
|
||
This may be None or an instance of EventLoop. | ||
"""Get the event loop for the current context. | ||
Returns an instance of EventLoop or raises an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a newline before "Returns". See https://www.python.org/dev/peps/pep-0257/ for the reference.
…' into AbstractEventLoopPolicyDocString # Conflicts: # Lib/asyncio/events.py
GH-16568 is a backport of this pull request to the 3.8 branch. |
GH-16569 is a backport of this pull request to the 3.7 branch. |
…nGH-16463) (cherry picked from commit b23a842) Co-authored-by: idomic <michael.ido@gmail.com>
) (cherry picked from commit b23a842) Co-authored-by: idomic <michael.ido@gmail.com>
) (cherry picked from commit b23a842) Co-authored-by: idomic <michael.ido@gmail.com>
Congrats on your first PR @idomic! |
…nGH-16463) (cherry picked from commit b23a842) Co-authored-by: idomic <michael.ido@gmail.com>
https://bugs.python.org/issue34344