##// END OF EJS Templates
comments about `*` for kw-only
Min RK -
Show More
@@ -79,6 +79,7 b' def _display_mimetype(mimetype, objs, raw=False, metadata=None):'
79 # Main functions
79 # Main functions
80 #-----------------------------------------------------------------------------
80 #-----------------------------------------------------------------------------
81
81
82 # use * to indicate transient is keyword-only
82 def publish_display_data(data, metadata=None, source=None, *, transient=None, **kwargs):
83 def publish_display_data(data, metadata=None, source=None, *, transient=None, **kwargs):
83 """Publish data and metadata to all frontends.
84 """Publish data and metadata to all frontends.
84
85
@@ -114,7 +115,7 b' def publish_display_data(data, metadata=None, source=None, *, transient=None, **'
114 to specify metadata about particular representations.
115 to specify metadata about particular representations.
115 source : str, deprecated
116 source : str, deprecated
116 Unused.
117 Unused.
117 transient : dict
118 transient : dict, keyword-only
118 A dictionary of transient data, such as display_id.
119 A dictionary of transient data, such as display_id.
119 """
120 """
120 from IPython.core.interactiveshell import InteractiveShell
121 from IPython.core.interactiveshell import InteractiveShell
@@ -214,6 +215,7 b' def display(*objs, include=None, exclude=None, metadata=None, transient=None, di'
214 return DisplayHandle(display_id)
215 return DisplayHandle(display_id)
215
216
216
217
218 # use * for keyword-only display_id arg
217 def update_display(obj, *, display_id, **kwargs):
219 def update_display(obj, *, display_id, **kwargs):
218 """Update an existing display by id
220 """Update an existing display by id
219
221
@@ -52,7 +52,8 b' class DisplayPublisher(Configurable):'
52 if not isinstance(metadata, dict):
52 if not isinstance(metadata, dict):
53 raise TypeError('metadata must be a dict, got: %r' % data)
53 raise TypeError('metadata must be a dict, got: %r' % data)
54
54
55 def publish(self, data, metadata=None, source=None, **kwargs):
55 # use * to indicate transient, update are keyword-only
56 def publish(self, data, metadata=None, source=None, *, transient=None, update=False, **kwargs):
56 """Publish data and metadata to all frontends.
57 """Publish data and metadata to all frontends.
57
58
58 See the ``display_data`` message in the messaging documentation for
59 See the ``display_data`` message in the messaging documentation for
@@ -88,6 +89,13 b' class DisplayPublisher(Configurable):'
88 the data itself.
89 the data itself.
89 source : str, deprecated
90 source : str, deprecated
90 Unused.
91 Unused.
92 transient: dict, keyword-only
93 A dictionary for transient data.
94 Data in this dictionary should not be persisted as part of saving this output.
95 Examples include 'display_id'.
96 update: bool, keyword-only, default: False
97 If True, only update existing outputs with the same display_id,
98 rather than creating a new output.
91 """
99 """
92
100
93 # The default is to simply write the plain text data using sys.stdout.
101 # The default is to simply write the plain text data using sys.stdout.
General Comments 0
You need to be logged in to leave comments. Login now