Skip to content

_repr_mimebundle_ ignores NotImplementedError #15154

@has2k1

Description

@has2k1
class Foo:
    def _repr_mimebundle_(self, include, exclude):
        raise NotImplementedError("This error is ignored")

Foo()

The is due to a deliberate change introduced in #4832 (to resolve issue #4792).
The recommended solution was for the formatter functions to return None.

As ignoring NotImplementedErrors also ignores those generated outside the formatter functions, would it make sense to either:

  1. revert the change, if the case that triggered it did switch to returning None.
  2. or, inspect and only ignore the error if it is indeed generated in the body of a formatter function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions