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 69ea1b3a8f45fec46add3272ad47f14ff5321ae8)
Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2025-07-19 17:36:31 +00:00
..
2025-07-19 15:56:40 +02:00
2025-07-09 09:23:43 +00:00
2025-02-20 23:58:58 +00:00
2025-05-28 17:25:06 +01:00
2025-07-11 12:57:52 +00:00
2025-05-05 15:32:06 +02:00
2025-07-12 13:56:10 +00:00
2025-07-03 10:18:27 +00:00
2025-05-05 19:46:46 +02:00
2025-07-04 07:26:03 +00:00
2025-06-16 08:05:26 +01:00
2025-06-29 07:12:50 +00:00
2025-04-08 11:14:12 +03:00
2025-06-05 14:38:09 +00:00
2025-06-25 18:03:13 +01:00
2025-07-19 17:36:31 +00:00
2025-04-28 19:04:20 +01:00
2025-07-08 11:57:23 +03:00
2025-05-03 07:54:33 +00:00
2025-05-09 15:17:24 +03:00
2025-07-15 10:22:24 +00:00
2025-05-19 21:24:53 +01:00
2025-07-19 15:56:40 +02:00
2025-07-19 17:36:31 +00:00
2025-05-03 16:57:09 +03:00
2024-12-19 15:24:47 -05:00
2025-06-14 09:11:31 +00:00
2025-05-05 17:03:42 +00:00
2025-05-18 22:33:14 +03:00
2024-11-12 15:59:19 +02:00
2025-07-03 08:15:01 +00:00
2025-07-19 17:36:31 +00:00
2025-06-08 20:12:25 +00:00
2025-06-30 14:58:18 +00:00
2024-12-06 19:50:58 +02:00
2024-12-09 13:28:57 +08:00
2025-05-08 13:40:44 +00:00
2025-04-15 20:10:53 +00:00
2025-05-05 23:45:25 +02:00
2025-02-06 11:40:43 +01:00
2025-05-01 10:28:52 +00:00
2025-05-03 17:58:49 +03:00
2025-06-26 04:09:11 +00:00
2025-07-07 19:24:30 +03:00
2025-05-21 17:57:58 +02:00
2025-06-27 14:12:15 +00:00
2025-05-05 15:00:15 +03:00
2024-10-13 21:05:05 +05:30
2025-06-18 13:26:58 +00:00
2025-06-01 06:21:34 +00:00
2025-05-30 18:24:59 +03:00
2025-01-14 13:25:33 +00:00
2025-04-15 18:31:52 -04:00
2025-04-27 14:41:30 -07:00
2025-05-05 19:46:46 +02:00
2025-05-03 22:50:37 -04:00
2025-05-05 19:46:46 +02:00
2025-07-10 16:09:45 +00:00
2025-04-22 11:01:55 +02:00
2025-05-05 19:46:46 +02:00
2025-06-15 16:38:15 +00:00
2024-11-07 01:12:45 +03:00
2024-12-30 18:18:42 +01:00
2025-04-24 16:49:09 +00:00
2025-04-24 14:41:01 -04:00
2025-01-18 11:45:18 +01:00
2025-07-19 17:36:31 +00:00
2024-09-28 20:51:49 +03:00
2025-06-27 10:26:51 +00:00
2025-05-05 19:46:46 +02:00
2025-07-15 17:07:01 +00:00
2025-04-24 23:13:54 -07:00
2025-05-03 17:58:21 +03:00
2025-07-07 19:24:24 +03:00
2025-05-08 08:26:14 +00:00
2025-06-03 14:05:00 +02:00
2024-11-26 10:54:02 +02:00
2025-05-15 15:41:37 +00:00
2025-03-06 23:41:03 +00:00
2025-05-03 17:58:21 +03:00
2025-03-18 16:28:00 -05:00
2025-05-05 19:46:46 +02:00
2025-06-01 10:26:56 +02:00
2025-05-05 17:52:49 +02:00
2025-04-12 17:43:11 +00:00
2025-02-06 19:15:11 -08:00
2025-05-26 08:22:14 +00:00
2025-04-28 08:38:56 -07:00
2025-05-28 15:50:40 +00:00
2025-04-02 19:50:01 -04:00
2025-06-11 12:43:20 +03:00
2025-04-27 14:41:30 -07:00
2025-05-05 19:46:46 +02:00
2025-06-22 20:12:57 +00:00
2025-06-03 14:05:00 +02:00
2025-03-19 19:33:01 +00:00
2025-03-28 10:35:20 +00:00
2025-01-20 00:03:19 +00:00
2025-06-30 10:44:29 +03:00
2025-05-24 03:34:17 +00:00
2025-05-05 19:46:46 +02:00
2025-05-05 19:46:46 +02:00
2025-03-12 15:03:36 +01:00
2025-06-16 14:58:14 +00:00
2025-03-02 08:05:40 -05:00
2025-06-03 14:05:00 +02:00
2025-01-23 14:49:36 +00:00
2024-09-24 20:06:39 +02:00
2025-05-05 19:46:46 +02:00
2025-05-19 17:22:14 +02:00
2025-05-05 19:46:46 +02:00
2025-06-24 12:02:02 +00:00
2025-04-24 16:10:46 +01:00
2025-05-06 01:38:08 +01:00
2025-05-20 22:15:23 +02:00
2025-01-17 16:49:16 -08:00
2025-01-17 16:49:16 -08:00
2024-12-24 18:29:27 +00:00
2025-04-28 23:05:37 -05:00
2025-05-05 01:15:31 +00:00
2025-06-03 14:05:00 +02:00
2025-05-21 17:36:32 +00:00
2025-05-03 17:58:49 +03:00
2025-05-22 14:14:53 +00:00
2025-03-30 14:19:38 +03:00
2025-05-02 20:22:31 +02:00
2025-05-26 15:24:24 -04:00
2025-05-05 19:46:46 +02:00
2025-06-02 16:58:03 +02:00
2025-01-18 11:27:22 +01:00
2025-04-05 18:11:07 +00:00
2025-07-07 00:10:57 +00:00
2025-06-08 12:13:04 +00:00
2025-04-09 16:18:54 -07:00
2025-07-16 07:26:52 +00:00
2024-10-13 21:05:05 +05:30
2025-05-05 19:46:46 +02:00
2025-05-05 19:46:46 +02:00
2025-02-11 23:59:09 +00:00