Skip to content

Conversation

@d-w-moore
Copy link
Collaborator

No description provided.

Copy link
Contributor

@alanking alanking left a comment

Choose a reason for hiding this comment

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

Please address or explicitly ignore Ruff as you see fit.

Comment on lines +136 to +138
if n in _default_MetadataManager_opts:
return self._manager._opts[n]
raise AttributeError
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of _default_MetadataManager_opts is a little confusing to me. Does this mean that we cannot access non-default options?

Does something like this improve the situation, or make it worse?

Suggested change
if n in _default_MetadataManager_opts:
return self._manager._opts[n]
raise AttributeError
if (attr := self._manager._opts.get(n)) is None:
raise AttributeError(f"Attribute [{n}] not found")
return attr

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried it that way and got a never-ending recursion, unfortunately : (



class iRODSMetaCollection:
def __getattr__(self,n):
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider changing n to name or some other more descriptive parameter name.

Comment on lines +30 to +35
_default_MetadataManager_opts = {
'admin':False,
'timestamps':False,
'iRODSMeta_type':iRODSMeta,
'reload':True
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this buy us over just... adding the new option to self._opts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Somehow doing it this way avoided a bottomless recursion. I do not know why....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants