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

Calling hasattr on Node always returns True #152

Open
markheik opened this issue Jun 8, 2022 · 0 comments
Open

Calling hasattr on Node always returns True #152

markheik opened this issue Jun 8, 2022 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@markheik
Copy link
Collaborator

markheik commented Jun 8, 2022

Description

hasattr always returns True

How to reproduce

Calling hasattr on Node always returns True

Environment info

  • Python version:
  • zhinst-toolkit version:
  • LabOne version:
  • zhinst version:

Device/system information (if applicable)

Additional information

hasattr should return True only on valid nodes/attributes or implement a more clear way to check child nodes other than child_nodes()

As hasattr calls getattr https://docs.python.org/3/library/functions.html#hasattr and Node always returns a attribute even though it is not valid (as node path validation happens only when a node is called.

@markheik markheik added bug Something isn't working enhancement New feature or request labels Jun 8, 2022
@markheik markheik changed the title hasattr always returns True Calling hasattr on Node always returns True Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant