Re: (objects as) mutable dictionary keys
From: Just (just_at_xs4all.nl)
Date: 01/17/05
- Next message: Do Re Mi chel La Si Do: "Re: OCAMl a more natural extension language for python?"
- Previous message: Ville Vainio: "Re: OCAMl a more natural extension language for python?"
- In reply to: Peter Maas: "Re: (objects as) mutable dictionary keys"
- Next in thread: John Roth: "Re: (objects as) mutable dictionary keys"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 17 Jan 2005 13:52:47 +0100
In article <csgb3d$hjn$1@swifty.westend.com>,
Peter Maas <peter@somewhere.com> wrote:
> Antoon Pardon schrieb:
> > Dictionary lookup with mutable types like lists is a source of
> > unpleasant surprises for the programmer and therefore impossible in
> > Python.
> >
> >
> > It is not impossible in Python.
Is too.
> > It may be discouraged but it is not
> > impossible since I have already done so.
>
> Wouldn't this raise a TypeError? Or did you wrap them with an object?
He created a list subclass that redefines __hash__, so he cheated :).
Just
- Next message: Do Re Mi chel La Si Do: "Re: OCAMl a more natural extension language for python?"
- Previous message: Ville Vainio: "Re: OCAMl a more natural extension language for python?"
- In reply to: Peter Maas: "Re: (objects as) mutable dictionary keys"
- Next in thread: John Roth: "Re: (objects as) mutable dictionary keys"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|