Skip to content

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Jan 10, 2020

This PR is only refactoring work, so the news is skipped. :)

https://bugs.python.org/issue39259

@corona10 corona10 requested a review from vstinner January 10, 2020 16:44
@vstinner vstinner changed the title nntplib.NNTP/NNTP_SSL refactoring bpo-39259: nntplib.NNTP/NNTP_SSL refactoring Jan 10, 2020
@vstinner
Copy link
Member

This PR is only refactoring work, so I skip the news and issue.

I prefer to always attach a bpo to get more context. This change is connected to: https://bugs.python.org/issue39259

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Hum, you changed how _NNTPBase. With this change, I'm not sure that it's still relevant to have _NNTPBase and NNTP. What do you think of merging _NNTPBase and NNTP into NNTP? The most tricky part is to merge the two __init__() methods. Maybe just move NNTP code at the end of _NNTPBase.init().

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@corona10
Copy link
Member Author

@vstinner Yes, that's reasonable. I will update this PR with merging 2 classes.

@corona10
Copy link
Member Author

@vstinner

self.server = nntplib._NNTPBase(file, 'test.server', *args, **kwargs)

Hmm... _NNTPBase is also used for testing server code.
IMHO, if we merge _NNTPBase and NNTP, the work looks pretty large.
How about creating a separate issue for this (e.g remove _NNTPBase)?

Lib/nntplib.py Outdated
usenetrc, timeout)

def _create_socket(self, timeout):
self.sock = super()._create_socket(timeout)
Copy link
Member

Choose a reason for hiding this comment

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

In NNTP, the method only creates a socket, it doesn't assign self.sock. Please replace self.sock with sock.

@vstinner
Copy link
Member

Hmm... _NNTPBase is also used for testing server code.
IMHO, if we merge _NNTPBase and NNTP, the work looks pretty large.
How about creating a separate issue for this (e.g remove _NNTPBase)?

Ok.

@corona10
Copy link
Member Author

@vstinner Updated!

Ok.

I will create a new issue for this :)

@corona10 corona10 requested a review from vstinner January 11, 2020 04:20
@vstinner vstinner merged commit 5d978a2 into python:master Jan 11, 2020
@corona10 corona10 deleted the nntplib_refactoring branch January 11, 2020 15:42
@corona10
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants