Skip to content

interpreter: void holder #9512

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mensinda
Copy link
Member

@mensinda mensinda commented Nov 1, 2021

The goal of this refactoring is to slightly simplify the logic in InterpreterBase by ensuring that even None now has a corresponding holder. This way we no longer have to check for it and can always assume that we are dealing with InterpreterObjects.

@mensinda mensinda requested a review from jpakkane as a code owner November 1, 2021 10:17
@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Attention: Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 67.33%. Comparing base (94a5ffa) to head (47ad7fb).
Report is 3062 commits behind head on master.

Files Patch % Lines
mesonbuild/interpreterbase/interpreterbase.py 60.86% 5 Missing and 4 partials ⚠️
mesonbuild/interpreterbase/void.py 70.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9512   +/-   ##
=======================================
  Coverage   67.33%   67.33%           
=======================================
  Files         396      398    +2     
  Lines       85539    85563   +24     
  Branches    17667    17665    -2     
=======================================
+ Hits        57599    57617   +18     
- Misses      23255    23261    +6     
  Partials     4685     4685           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

A couple of small nits, but otherwise this is a nice change.

@property
def is_assignable(self) -> bool:
''' Property used to indicate whether an object can be used at all '''
return True
Copy link
Member

Choose a reason for hiding this comment

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

properties are really slow, you generally want to avoid using them if at all possible, I'd make this a class variable instead, set the base class to True, and have the VoidHolder class override it in its class definition.

@@ -0,0 +1,16 @@
# Copyright 2021 The Meson development team
# SPDX-license-identifier: Apache-2.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# SPDX-license-identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants