Skip to content

Refactor: use context manager for Scope #11053

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 1 commit into from
Sep 6, 2021

Conversation

97littleleaf11
Copy link
Collaborator

Description

Related issue: #1184
Follows up to #10569, #10685

This PR:

  • Refactors Scope
    • Replaces Scope.enter_file with Scope.module_scope
    • Replaces Scope.enter_function with Scope.function_scope
    • Splits Scope.leave() into corresponding context manager
  • Deletes unused files

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good. This makes things less error-prone and the code easier to follow.

@JukkaL JukkaL merged commit 725a24a into python:master Sep 6, 2021
@97littleleaf11 97littleleaf11 deleted the refactor-1184 branch September 6, 2021 16:43
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.

2 participants