Addresses https://github.com/FEniCS/ufl/issues/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.
Addresses https://github.com/FEniCS/ufl/issues/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
inFiniteElementBase.__getitem__
may be inappropriate since (I think)__getitem__
is not one of the binary operations for whichNotImplemented
is intended, so it is replaced with aKeyError
when an invalid restriction is supplied.