Commit e5ed57e
committed
gh-146406: add clear() cross-language hint for immutable types
Follow-up to PR #146407. Calling .clear() on a tuple, frozenset, or
frozendict now suggests the mutable counterpart (list / set / dict),
mirroring the existing append/extend/insert/remove/discard/update
entries for the same immutable types.
Triggered by @henryiii noticing that .clear() was the first method
they tried on these types and got no useful suggestion, and
@vstinner agreeing it was worth adding.
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>1 parent 5f8d9d3 commit e5ed57e
3 files changed
Lines changed: 10 additions & 0 deletions
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4637 | 4637 | | |
4638 | 4638 | | |
4639 | 4639 | | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
4640 | 4643 | | |
4641 | 4644 | | |
4642 | 4645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1775 | 1775 | | |
1776 | 1776 | | |
1777 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
1778 | 1782 | | |
1779 | 1783 | | |
1780 | 1784 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments