Skip to content

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.

RAT/classlist.py Outdated
self._setitem(index, item)

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
@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