To close the loop, I've rejected the PEP, adding the following rejection notice:
I'm rejecting this PEP. A number of reasons (not exhaustive):
* According to Raymond Hettinger, use of frozendict is low. Those
that do use it tend to use it as a hint only, such as declaring
global or
2012/3/22 Guido van Rossum gu...@python.org:
To close the loop, I've rejected the PEP, adding the following rejection
notice:
I'm rejecting this PEP. (...)
Hum, you may specify who is I in the PEP.
Victor
___
Python-Dev mailing list
On the other hand, exposing the existing read-only dict proxy as a
built-in type sounds good to me. (It would need to be changed to
allow calling the constructor.)
I wrote a small patch to implement this request:
http://bugs.python.org/issue14386
I also opened the following issue to support
Le 01/03/2012 14:49, Paul Moore a écrit :
Just avoid using the term immutable at all:
You right, I removed mention of mutable/immutable from the PEP.
Victor
___
Python-Dev mailing list
Python-Dev@python.org
Is your implementation (adapted to a standalone type) something you
could put up on the cheeseshop?
Short answer: no.
My implementation (attached to the issue #14162) reuses most of
private PyDict functins which are not exported and these functions
have to be modified to accept a frozendict as
Le 29/02/2012 19:21, Victor Stinner a écrit :
Rationale
=
(...) Use cases of frozendict: (...)
I updated the PEP to list use cases described in the other related
mailing list thread.
---
Use cases:
* frozendict lookup can be done at compile time instead of runtime
because the
On Sat, Mar 3, 2012 at 4:11 PM, Victor Stinner victor.stin...@gmail.com wrote:
Le 29/02/2012 19:21, Victor Stinner a écrit :
Rationale
=
(...) Use cases of frozendict: (...)
I updated the PEP to list use cases described in the other related mailing
list thread.
---
Use cases:
Rationale
=
A frozendict mapping cannot be changed, but its values can be mutable
(not hashable). A frozendict is hashable and so immutable if all
values are hashable (immutable).
The wording of the above seems very unclear to me.
Do you mean A frozendict has a constant set of
An immutable mapping can be implemented using frozendict::
class immutabledict(frozendict):
def __new__(cls, *args, **kw):
# ensure that all values are immutable
for key, value in itertools.chain(args, kw.items()):
if not isinstance(value,
Rationale
=
A frozendict mapping cannot be changed, but its values can be mutable
(not hashable). A frozendict is hashable and so immutable if all
values are hashable (immutable).
The wording of the above seems very unclear to me.
Do you mean A frozendict has a constant set of
On 1 March 2012 12:08, Victor Stinner victor.stin...@gmail.com wrote:
New try:
A frozendict is a read-only mapping: a key cannot be added nor
removed, and a key is always mapped to the same value. However,
frozendict values can be mutable (not hashable). A frozendict is
hashable and so
As requested, I create a PEP and a related issue:
http://www.python.org/dev/peps/pep-0416/
http://bugs.python.org/issue14162
The PEP 416 is different from my previous propositions: frozendict
values can be mutable and dict doesn't inherit from frozendict
anymore. But it is still possible to use
On Wed, 2012-02-29 at 19:21 +0100, Victor Stinner wrote:
As requested, I create a PEP and a related issue:
http://www.python.org/dev/peps/pep-0416/
[...snip...]
Rationale
=
A frozendict mapping cannot be changed, but its values can be mutable
(not hashable). A frozendict is
Rationale
=
A frozendict mapping cannot be changed, but its values can be mutable
(not hashable). A frozendict is hashable and so immutable if all
values are hashable (immutable).
The wording of the above seems very unclear to me.
Do you mean A frozendict has a constant set
In http://mail.python.org/pipermail/python-dev/2012-February/117113.html
Victor Stinner posted:
An immutable mapping can be implemented using frozendict::
class immutabledict(frozendict):
def __new__(cls, *args, **kw):
# ensure that all values are immutable
15 matches
Mail list logo