exception handling, which presumably makes it work for non-python objects