Skip to content

Prevent deprecation warning for PersistentDict: use PersistentMapping.#130

Merged
mauritsvanrees merged 1 commit intomasterfrom
maurits-deprecation-persistent
Dec 12, 2025
Merged

Prevent deprecation warning for PersistentDict: use PersistentMapping.#130
mauritsvanrees merged 1 commit intomasterfrom
maurits-deprecation-persistent

Conversation

@mauritsvanrees
Copy link
Member

persistent/dict.py simply has this code, for a long time now:

from zope.deferredimport import deprecated

deprecated(
    "`persistent.dict.PersistentDict` is deprecated. Use"
    " `persistent.mapping.PersistentMapping` instead."
    " This backward compatibility shim will be removed in persistent"
    " version 7.",
    PersistentDict='persistent.mapping:PersistentMapping',
)

Originally this was supposed to be removed in version 6. And already since persistent 4.0.0 from 2012 is PersistentDict a backwards compatibility import for PersistentMapping.

So it seems safe to finally make the shift here. :-)

`persistent/dict.py`  simply has this code, for a long time now:

```
from zope.deferredimport import deprecated

deprecated(
    "`persistent.dict.PersistentDict` is deprecated. Use"
    " `persistent.mapping.PersistentMapping` instead."
    " This backward compatibility shim will be removed in persistent"
    " version 7.",
    PersistentDict='persistent.mapping:PersistentMapping',
)
```

Originally this was supposed to be removed in version 6.
And already since `persistent` 4.0.0 from 2012 is `PersistentDict` a backwards compatibility import for `PersistentMapping`.

So it seems safe to finally make the shift here. :-)
@mister-roboto
Copy link

@mauritsvanrees thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@mauritsvanrees
Copy link
Member Author

@jenkins-plone-org please run jobs

@mauritsvanrees mauritsvanrees merged commit bbb4dcc into master Dec 12, 2025
12 checks passed
@mauritsvanrees mauritsvanrees deleted the maurits-deprecation-persistent branch December 12, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants