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

Adds new features to ClassList #11

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

DrPaulSharp
Copy link
Collaborator

We add the ability to:

  • set an item in the ClassList using an object
  • determine the class handle by ensuring "isinstance" is true for all elements (allows ProtectedParameters to be included correctly.)
  • iadd and extend the ClassList with the expected behaviour for individual objects.

tests/test_classlist.py Outdated Show resolved Hide resolved
RAT/classlist.py Outdated

def _setitem(self, index: int, set_dict: dict[str, Any]) -> None:
def _setitem(self, index: int, item: Union['RAT.models', dict[str, Any]]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be better to support one type i.e only models or dict (my pick is models) then provide a fallback for anyone who wants to use the alternate e.g. add_rows_as_type. Otherwise there will be failing edge cases in the current design

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's fine with me. I'll get on it!

@DrPaulSharp DrPaulSharp merged commit eb2ec43 into RascalSoftware:main Sep 21, 2023
6 checks passed
@DrPaulSharp DrPaulSharp deleted the classlist branch September 21, 2023 14:12
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