From 4842416da03f3cc04897bd8731e851c2f0c0e734 2019-08-13 16:33:59 From: Matthias Bussonnier Date: 2019-08-13 16:33:59 Subject: [PATCH] Merge pull request #11852 from danielballan/formatter-usage Fix example usage of BaseFormatter.for_type_by_name. --- diff --git a/docs/source/config/integrating.rst b/docs/source/config/integrating.rst index ded720f..0a1f0ec 100644 --- a/docs/source/config/integrating.rst +++ b/docs/source/config/integrating.rst @@ -85,7 +85,7 @@ Formatters for third-party types The user can also register formatters for types without modifying the class:: - from bar import Foo + from bar.baz import Foo def foo_html(obj): return 'Foo object %s' % obj.name @@ -94,7 +94,7 @@ The user can also register formatters for types without modifying the class:: html_formatter.for_type(Foo, foo_html) # Or register a type without importing it - this does the same as above: - html_formatter.for_type_by_name('bar.Foo', foo_html) + html_formatter.for_type_by_name('bar.baz', 'Foo', foo_html) Custom exception tracebacks ===========================