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

Simplify code in warnings modules #1935

Merged
merged 1 commit into from
Jun 4, 2017
Merged

Simplify code in warnings modules #1935

merged 1 commit into from
Jun 4, 2017

Conversation

alex
Copy link
Member

@alex alex commented Jun 4, 2017

Metaprogramming a list of attributes was excessive, and made the code less readable and slower.

Metaprogramming a list of attributes was excessive, and made the code less readable and slower.
@mention-bot
Copy link

@alex, thanks for your PR! By analyzing the history of the files in this pull request, we identified @brettcannon, @tiran and @birkenfeld to be potential reviewers.

@alex alex added the trivial label Jun 4, 2017
@@ -397,9 +397,13 @@ class WarningMessage(object):

def __init__(self, message, category, filename, lineno, file=None,
line=None, source=None):
local_values = locals()
for attr in self._WARNING_DETAILS:
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only use of _WARNING_DETAILS? Does it make sense to just get rid of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's not. There's a usage in Lib/test/support/__init__.py

Copy link
Member

Choose a reason for hiding this comment

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

Okay.

@dstufft dstufft merged commit 5de3a64 into master Jun 4, 2017
@dstufft dstufft deleted the alex-patch-2 branch June 4, 2017 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants