@@ -163,15 +163,23 @@ cancelled it is the empty value documented for that function -- an empty
163163string, an empty tuple, an empty list or ``None ``.
164164
165165.. function :: askopenfile(mode="r", **options)
166- askopenfiles(mode="r", **options)
167166
168- Create an :class: `Open ` dialog.
169- :func: `askopenfile ` returns the opened file object, or ``None `` if the
170- dialog is cancelled.
171- :func: `askopenfiles ` returns a list of the opened file objects, or an empty
172- list if cancelled.
167+ Create an :class: `Open ` dialog and return the opened file object,
168+ or ``None `` if the dialog is cancelled.
169+ The file is opened in mode *mode * (read-only ``'r' `` by default).
170+
171+ .. function :: askopenfiles(mode="r", **options)
172+
173+ Create an :class: `Open ` dialog and return a list of the opened file objects,
174+ or an empty list if cancelled.
173175 The files are opened in mode *mode * (read-only ``'r' `` by default).
174176
177+ .. deprecated-removed :: next 3.19
178+ Opening several files at once is error-prone,
179+ and the returned list cannot be used in a :keyword: `with ` statement.
180+ Iterate over the names returned by :func: `askopenfilenames `
181+ and open them one by one instead.
182+
175183.. function :: asksaveasfile(mode="w", **options)
176184
177185 Create a :class: `SaveAs ` dialog and return the opened file object, or
@@ -201,19 +209,16 @@ string, an empty tuple, an empty list or ``None``.
201209
202210.. class :: Open(master=None, **options)
203211 SaveAs(master=None, **options)
212+ Directory(master=None, **options)
204213
205- The above two classes provide native dialog windows for saving and loading
206- files.
214+ The above three classes provide native dialog windows for loading and saving
215+ files and for selecting a directory .
207216
208217**Convenience classes **
209218
210219The below classes are used for creating file/directory windows from scratch.
211220These do not emulate the native look-and-feel of the platform.
212221
213- .. class :: Directory(master=None, **options)
214-
215- Create a dialog prompting the user to select a directory.
216-
217222.. note :: The *FileDialog* class should be subclassed for custom event
218223 handling and behaviour.
219224
@@ -353,23 +358,25 @@ the classic (non-themed) Tk widgets.
353358
354359.. data :: DIALOG_ICON
355360
356- The name of the default bitmap (``'questhead' ``) displayed by a
357- :class: `Dialog `.
361+ The name of a bitmap (``'questhead' ``) suitable for use as the * bitmap *
362+ of a :class: `Dialog `.
358363
359364.. class :: Dialog(master=None, cnf={}, **kw)
360365
361366 Display a modal dialog box built from the classic (non-themed) Tk widgets
362367 and wait for the user to press one of its buttons.
363- The options, given through *cnf * or as keyword arguments, include * title *
364- (the window title), *text * (the message), *bitmap * (an icon,
365- :data: `DIALOG_ICON ` by default ), *default * (the index of the default button)
366- and *strings * (the sequence of button labels).
368+ The options, given through *cnf * or as keyword arguments, are all required:
369+ * title * (the window title), *text * (the message), *bitmap * (the name of a
370+ bitmap icon, such as :data: `DIALOG_ICON `), *default * (the index of the
371+ default button) and *strings * (the sequence of button labels).
367372 After construction, the :attr: `!num ` attribute holds the index of the button
368373 the user pressed.
369374
370375 .. method :: destroy()
371376
372- Destroy the dialog window.
377+ Do nothing.
378+ The dialog window is destroyed automatically before the constructor
379+ returns, so there is nothing left for this method to do.
373380
374381
375382.. seealso ::
0 commit comments