Skip to content
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

Add FrozenRequirement._init_args_from_dist() helper method #5818

Merged
merged 1 commit into from
Sep 30, 2018

Conversation

cjerdonek
Copy link
Member

This refactors from FrozenRequirement.from_dist() a helper class method I'm calling FrozenRequirement._init_args_from_dist().

This will be useful for issue #5031 (and independently of that issue) because it will let us use guard clauses to reduce indentation, cut down on the number of if-elses, and possibly remove some of the boolean "flag" variables. (Issue #5031 will likely require adding another if clause, which is what sparked this PR.)

@cjerdonek cjerdonek added type: refactor Refactoring code C: freeze 'pip freeze' related skip news Does not need a NEWS file entry (eg: trivial changes) labels Sep 27, 2018
@cjerdonek cjerdonek added this to the Internal Cleansing milestone Sep 27, 2018
@cjerdonek
Copy link
Member Author

@pradyunsg Can you review this one? It's very easy and is a dependency for #5031. Thanks!

@cjerdonek
Copy link
Member Author

@uranusjr Would you mind reviewing this simple PR for another pair of eyes?

Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

I wonder if those flags and if-elses can be implemented cleaner with subclasses, but this helper method would make it easier to override behaviours in subclasses for that approach as well.

@cjerdonek
Copy link
Member Author

Thanks!

@cjerdonek cjerdonek merged commit 356dc43 into pypa:master Sep 30, 2018
@cjerdonek cjerdonek deleted the simplify-from-dist branch September 30, 2018 09:30
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants