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

Adopt "future" behavior of statement() and frame() #2221

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

As promised, adopt the "future" behavior of statement() and frame().

Refs #1217

@jacobtylerwalls jacobtylerwalls added the Maintenance Discussion or action around maintaining astroid or the dev workflow label Jun 22, 2023
@jacobtylerwalls jacobtylerwalls added this to the 3.0.0a6 milestone Jun 22, 2023
Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

One nit, rest looks good! Thanks for doing this!

@@ -388,23 +388,9 @@ def statement(self, *, future: Literal[True]) -> NoReturn:
def statement(self, *, future: Literal[None, True] = None) -> Module | NoReturn:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def statement(self, *, future: Literal[None, True] = None) -> Module | NoReturn:
def statement(self, *, future: Literal[None, True] = None) -> NoReturn:

@@ -541,19 +541,19 @@ def _test(self, value: Any) -> None:
self.assertIs(node.value, value)
self.assertTrue(node._proxied.parent)
self.assertEqual(node._proxied.root().name, value.__class__.__module__)
with self.assertRaises(AttributeError):
with self.assertRaises(StatementMissing):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Smart re-use of the test!

@jacobtylerwalls jacobtylerwalls merged commit e3ba1ca into pylint-dev:main Jun 22, 2023
13 of 14 checks passed
@jacobtylerwalls jacobtylerwalls deleted the future branch June 22, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants