avoid access to global namespace in __eq__ methods
avoid access to global namespace in __eq__ methods

In combination with weak key or value dictionaries it may happen that at
destruction objects in the global namespace are already replace by None,
causing in particular isinstance invocations to fail. The (binary) method
weakref._remove_dead_weakref performs an equality check, leading to unhandled
exception warnings if this check uses isinstance to check the type if the
counterpart. This patch avoids this by using type(self) rather than the global
variable. In addition it replaces isinstance with equality checks for speed.

joostvanzwieten/nutils,wijnandhoitinga/nutils