-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Could we add an option to disable key caching like I added in jsonyx 2.2? Or should we tell people to use my library instead? We already have the option to disable checking for circular references in json.dumps()
which is much more dangerous.
>>> b"abc".decode() is not "abc" # "abc" is not interned
True
>>> dcts = json.loads('[{"abc": 1}, {"abc": 2}, {"abc": 3}]')
>>> len({id(key) for dct in dcts for key in dct})
1
>>> dcts = json.loads('[{"abc": 1}, {"abc": 2}, {"abc": 3}]', cache_keys=False)
>>> len({id(key) for dct in dcts for key in dct})
3
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done