python-frozendict: Frozendict is broken on Python 3.8, warns on 3.7
Closing because this repo is abandoned in favor of https://github.com/Marco-Sulla/python-frozendict
Hi! FYI, the following line is emitting deprecation warnings, and will break on Python 3.8:
That’s because all of the abstract base classes have been moved from collections in Python 2, to collections.abc in Python 3. The warning was added in python/cpython#5460. Could you try to import from collections.abc and fall back to the existing style?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 25 (3 by maintainers)
Commits related to this issue
- Replace frozendict by immutabledict See https://github.com/slezica/python-frozendict/issues/25 — committed to JelleAalbers/strax by JelleAalbers 4 years ago
- Migrate from frozendict to immutabledict. See https://github.com/slezica/python-frozendict/issues/25. — committed to google/python-spanner-orm by dseomn 3 years ago
- Fix a whole bunch of deprecation warnings We had accrued a big bunch of deprecation warnings (which usually showed up when running the tests) which would cause breakage in future Python versions. Th... — committed to ulope/raiden by ulope 3 years ago
- Fix a whole bunch of deprecation warnings We had accrued a big bunch of deprecation warnings (which usually showed up when running the tests) which would cause breakage in future Python versions. Th... — committed to ulope/raiden by ulope 3 years ago
- Fix a whole bunch of deprecation warnings We had accrued a big bunch of deprecation warnings (which usually showed up when running the tests) which would cause breakage in future Python versions. Th... — committed to raiden-network/raiden by ulope 3 years ago
- Remove use of frozendict in language manual The use of frozendict might be confusing and the package does not work on recent Python versions [1]. [1] https://github.com/slezica/python-frozendict/iss... — committed to Alexander-N/apalache by Alexander-N 3 years ago
- Fix a whole bunch of deprecation warnings We had accrued a big bunch of deprecation warnings (which usually showed up when running the tests) which would cause breakage in future Python versions. Th... — committed to raiden-network/raiden by ulope 3 years ago
EDIT new repo is here: https://github.com/Marco-Sulla/python-frozendict/
OLD ANSWER:
If you are interested, I reimplemented frozendict starting from forking the @slezica 's code. I asked Lezica to became co-admin of Pypi project and he consented, but since we are both very busy we have to do it yet… 😛
Major differences:
+and-operands are supported.+with a dict-like creates a newfrozendictmerged with the other object.-creates a newfrozendictwithout the keys included in the second operand, that can be any iterable. Addition of the operator+(or|) is also in an official PEP fordict, that seems to be very popular.repr()returns aneval-friendly string. Use it with caution 😄pytest) and a benchmark script__version__variable is in thefrozendictmoduledictimmutable API is supported,fromkeys()includedpickleis supported (don’t know if it was already supported before)copy()andfrozendict(another_frozendict)does not create another object, but returns the same instance. This is the same behaviour of all CPython immutables.__init__again after the object is instantiatedPS: I’m working also to a CPython version of
frozendict. I had only to supportpickle, but now I’m very busy. I hope it will be accepted by CPython devs.If anyone is interested, I released a fork on PyPI which supports Python 3.8 : https://pypi.org/project/immutabledict
@slezica Hi Santiago! Thank you very much for this project!
As you see, the code won’t work on Python 3.9 (they actually delayed it from 3.8). This project is widely used (163k downloads last month according to https://pypistats.org/packages/frozendict!) and it would be a shame for it to have to be removed or replaced in projects.
I understand if you’ve moved on and have other interests. Please would you consider giving merge and PyPI rights to another maintainer?
I’d suggest @corenting if they’re willing, who took initiative to make a fork, and perhaps @ppolewicz, @lurch and @eugene-eeo who were pinged for review in #15, and @mskoenz volunteered above. It’s always sensible to have more than one maintainer, to reduce the bus factor and burden. I would be happy to help with some of the maintenance tasks too to help get a new release out.
Additionally to consider, a transfer to https://jazzband.co, which provides additional maintainer backup.
What do you think?
Again, thank you for this project!
Version 2.0.2 released. Unluckily, Pypi supports only manylinux builds, so there’s only the pure py version for now. For any problems, please write here: https://github.com/Marco-Sulla/python-frozendict/issues/new/choose
Looks like the PyPI transfer has happened!
Well, the problem is @slezica wrote me some days ago, and I missed the mail 😛 So I responded to him yesterday. And yes, I think that’s no problem for me and Lezica to accept maintainers.
Hi! First, thx for the great python module 😃
Is it possible to get PR (#23) and subsequent update on pip? Would really help, especially for those that treat warning as errors in testing pipelines. If the author is no longer interested in maintaining the project, I’m happy to help out, dm me!
Cheers, m
There’s a PR for this (#23) but I’m worried that the owner has more-or-less abandoned this project.
I’ve also emailed Santiago the above in case he doesn’t get notifications here.
Yeah like @mskoenz I can help maintain the project and put the changes from my fork back into the repository if necessary.
@Zac-HD Could you please add the link to your first post?
Now that @Marco-Sulla has taken over the PyPI project (congrats!), perhaps @slezica could update his
README.rstto mention that this repo is now deprecated, and pointing people at the new repo instead? 🙂Well, finally 😃 Now I’m a bit busy, in the weekend I’ll release v2.0.1: https://github.com/Marco-Sulla/python-frozendict/releases/tag/v2.0.1
@Marco-Sulla Cool, as long as your new version (which sounds pretty good) is explicitly not a drop-in replacement for @slezica 's
frozendict, then I agree it doesn’t make sense to add Python2 support to your new version 👍