forked frompython/cpython
- Notifications
You must be signed in to change notification settings - Fork0
Commitd7773d9
bpo-18533: Avoid RecursionError from repr() of recursive dictview (python#4823)
dictview_repr(): Use a Py_ReprEnter() / Py_ReprLeave() pair to checkfor recursion, and produce "..." if so.test_recursive_repr(): Check for the string rather than aRecursionError. (Test cannot be any tighter as contents areimplementation-dependent.)test_deeply_nested_repr(): Add new test, replacing the originaltest_recursive_repr(). It checks that a RecursionError is raised inthe case of a non-recursive but deeply nested structure. (Verysimilar to what test_repr_deep() in test/test_dict.py does for anormal dict.)OrderedDictTests: Add new test case, to test behavior on OrderedDictinstances containing their own values() or items().1 parente76daeb commitd7773d9
File tree
4 files changed
+44
-4
lines changed- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Objects
4 files changed
+44
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
205 | 220 | | |
206 | 221 | | |
207 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
358 | 372 | | |
359 | 373 | | |
360 | 374 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3853 | 3853 | | |
3854 | 3854 | | |
3855 | 3855 | | |
3856 | | - | |
| 3856 | + | |
| 3857 | + | |
3857 | 3858 | | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
3858 | 3863 | | |
3859 | | - | |
3860 | | - | |
3861 | | - | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
3862 | 3867 | | |
3863 | 3868 | | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
3864 | 3872 | | |
3865 | 3873 | | |
3866 | 3874 | | |
| |||
0 commit comments
Comments
(0)