Skip to content

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

Merged
merged 7 commits into from
Oct 3, 2019

Conversation

idomic
Copy link
Contributor

@idomic idomic commented Sep 28, 2019

Copy link
Member

@brandtbucher brandtbucher left a 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:

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No leading space here:

Suggested change
""" Get the event loop for the current context.
"""Get the event loop for the current context.


It should never return None."""
""" Get the event loop for the current context.
Returns an instance of EventLoop or raises an exception.
Copy link
Member

@brandtbucher brandtbucher Sep 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No hanging indent here:

Suggested change
Returns an instance of EventLoop or raises an exception.
Returns an instance of EventLoop or raises an exception.

It should never return None."""
""" Get the event loop for the current context.
Returns an instance of EventLoop or raises an exception.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad indent here:

Suggested change
"""
"""

@idomic
Copy link
Contributor Author

idomic commented Oct 1, 2019

Thanks @brandtbucher for the warm welcome and the detailed comments.
I've removed the past change and fixed the remarks on the docstring at line 632.

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.
Copy link
Member

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.

idomic added 2 commits October 2, 2019 15:00
…' into AbstractEventLoopPolicyDocString

# Conflicts:
#	Lib/asyncio/events.py
@1st1 1st1 merged commit b23a842 into python:master Oct 3, 2019
@miss-islington
Copy link
Contributor

Thanks @idomic for the PR, and @1st1 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-16568 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-16569 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 3, 2019
…nGH-16463)

(cherry picked from commit b23a842)

Co-authored-by: idomic <michael.ido@gmail.com>
miss-islington added a commit that referenced this pull request Oct 3, 2019
)

(cherry picked from commit b23a842)

Co-authored-by: idomic <michael.ido@gmail.com>
miss-islington added a commit that referenced this pull request Oct 3, 2019
)

(cherry picked from commit b23a842)

Co-authored-by: idomic <michael.ido@gmail.com>
@brandtbucher
Copy link
Member

Congrats on your first PR @idomic!

ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 14, 2019
…nGH-16463)

(cherry picked from commit b23a842)

Co-authored-by: idomic <michael.ido@gmail.com>
@idomic idomic deleted the AbstractEventLoopPolicyDocString branch December 1, 2019 20:07
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news topic-asyncio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants