[Python-Dev] Add a frozendict builtin type (original) (raw)

Paul Moore p.f.moore at gmail.com
Wed Feb 29 22:08:20 CET 2012


On 29 February 2012 19:17, Raymond Hettinger <raymond.hettinger at gmail.com> wrote:

From this experience, I conclude that adding a frozendict type would be a total waste (except that it would inspire more people to request frozen variante of other containers).

It would (apparently) help Victor to fix issues in his pysandbox project. I don't know if a secure Python sandbox is an important enough concept to warrant core changes to make it possible. However, if Victor was saying that implementing this PEP was all that is needed to implement a secure sandbox, then that would be a very different claim, and likely much more compelling (to some, at least - I have no personal need for a secure sandbox).

Victor quotes 6 implementations. I don't see any rationale (either in the email that started this thread, or in the PEP) to explain why these aren't good enough, and in particular why the implementation has to be in the core. There's the hint in the PEP "If frozendict is used to harden Python (security purpose), it must be implemented in C". But why in the core (as opposed to an extension)? And why and how would frozendict help in hardening Python?

As it stands, I don't find the PEP compelling. The hardening use case might be significant but Victor needs to spell it out if it's to make a difference.

Paul.



More information about the Python-Dev mailing list