Skip to content

Commit

Permalink
Improved comment and changed exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
heplesser committed Mar 13, 2024
1 parent f68c60e commit 49009d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pynest/nest/lib/hl_api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,11 @@ def __getattr__(self, attr):
raise AttributeError("Cannot get attribute of empty NodeCollection")

# IPython looks up this method when doing pretty printing
# Without special casing this, this would go through SLI which is *slow*
# As long as we do not provide special methods to support IPython prettyprinting,
# HTML-rendering, etc, we stop IPython from time-consuming checks by raising an
# exception here. The exception must *not* be AttributeError.
if attr == "_ipython_canary_method_should_not_exist_":
raise KeyError(attr)
raise NotImplementedError("_ipython_canary_method_should_not_exist_")

if attr == "spatial":
metadata = sli_func("GetMetadata", self._datum)
Expand Down

0 comments on commit 49009d9

Please sign in to comment.