-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Description
Feature or enhancement
Proposal:
json.dump(check_circular=True) uses a dictionary to track all objects already visited and creates keys with PyLong_FromVoidPtr
. There is another solution for recursive container types in CPython already: Py_ReprEnter
and Py_ReprLeave
.
I have a patch to replace the dictionary and custom object tracking with the CPython functions and that removes some code and also avoids allocating Long objects for each recursive call.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Projects
Status
No status