cpython/Lib/tkinter
Miss Islington (bot) 4606b4089d
[3.14] gh-136839: Refactor simple dict.update calls (GH-136811) (#136840)
gh-136839: Refactor simple dict.update calls (GH-136811)

Refactor simple dict.update calls

This commit refactors simple `dict.update({key: value})` calls which can
be done via `dict[key] = value` instead.

I found those cases with the [semgrep](https://semgrep.dev/) tool:

```
$ semgrep --lang python --pattern '$DICT.update({$A: ...})'

┌─────────────────┐
│ 5 Code Findings │
└─────────────────┘

    Lib/dataclasses.py
         1268┆ slots.update({slot: doc})

    Lib/multiprocessing/resource_tracker.py
           50┆ _CLEANUP_FUNCS.update({
           51┆     'semaphore': _multiprocessing.sem_unlink,
           52┆ })
            ⋮┆----------------------------------------
           53┆ _CLEANUP_FUNCS.update({
           54┆     'shared_memory': _posixshmem.shm_unlink,
           55┆ })

    Lib/tkinter/scrolledtext.py
           26┆ kw.update({'yscrollcommand': self.vbar.set})

    Lib/xmlrpc/server.py
          242┆ self.funcs.update({'system.multicall' : self.system_multicall})
```
(cherry picked from commit 69ea1b3a8f)

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2025-07-19 17:36:31 +00:00
..
__init__.py gh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionMenu (GH-130502) 2025-05-02 14:38:50 +03:00
__main__.py
colorchooser.py bpo-33289: Return RGB triplet of ints instead of floats from tkinter.colorchooser (GH-6578) 2021-01-21 21:14:04 +02:00
commondialog.py gh-84623: Remove unused imports in stdlib (#93773) 2022-06-13 16:28:41 +02:00
constants.py
dialog.py gh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547) 2022-09-27 14:05:05 +03:00
dnd.py bpo-15303: Support widgets with boolean value False in Tkinter (GH-23904) 2020-12-25 17:04:26 +02:00
filedialog.py gh-102799: use exception instance instead of sys.exc_info() (#102885) 2023-03-31 11:23:02 +01:00
font.py bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968) 2020-12-29 12:56:55 +02:00
messagebox.py bpo-29446: tkinter 'import *' only imports what it should (GH-14864) 2019-07-25 21:30:33 -04:00
scrolledtext.py [3.14] gh-136839: Refactor simple dict.update calls (GH-136811) (#136840) 2025-07-19 17:36:31 +00:00
simpledialog.py gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
ttk.py gh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionMenu (GH-130502) 2025-05-02 14:38:50 +03:00