Skip to content

Code improvement opportunities #171

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

Closed
fanpu opened this issue Aug 15, 2020 · 1 comment · Fixed by #187
Closed

Code improvement opportunities #171

fanpu opened this issue Aug 15, 2020 · 1 comment · Fixed by #187

Comments

@fanpu
Copy link
Contributor

fanpu commented Aug 15, 2020

Expected Behavior

N/A, same behavior, syntax change

Actual Behavior

N/A, same behavior, syntax change

Steps to Reproduce the Behavior

N/A, same behavior, syntax change

From this comment #160 (comment):

Most if not all of the keys() calls in the code do not require the list form of the keys (you only need to listify the keys if you either want to use [] to access elements of the key list, or if you will alter the dict while iterating over the keys). Furthermore, a more readable way to do
if vmName in self.machines.keys():

would be to implement __contains__ in the Tango*Dictionary classes themselves and then call

if vmName in self.machines:

instead. TangoRemoteDictionary could use HEXISTS to implement __contains__ and not have to fetch everything.

@clairecw
Copy link
Contributor

Fixed by #187 ?

@fanpu fanpu closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants