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

Make FiniteElementBase subscriptable but not iterable #180

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

conpierce8
Copy link
Contributor

Addresses #179. This changes makes FiniteElementBase raise an error when __iter__ is called, so that Python does not treat it as an iterable object.

In addition, it appears that the use of NotImplemented in FiniteElementBase.__getitem__ may be inappropriate since (I think) __getitem__ is not one of the binary operations for which NotImplemented is intended, so it is replaced with a KeyError when an invalid restriction is supplied.

@mscroggs mscroggs merged commit ebfb2df into FEniCS:main Jul 12, 2023
@conpierce8 conpierce8 deleted the element-unpacking branch November 1, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants