![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: Dictionary, keys and alias
From: Steven D'Aprano <steve@REMOVETHIScyber.com.au>
Date: Mon Jul 18 2005 - 15:18:48 CEST
On Mon, 18 Jul 2005 12:17:37 +0200, Glauco wrote:
> I want to insert a concept of alias in a dict_based class.
You need some sort of redirection, something like this (untested):
class Doubledict:
def setalias(self, key, alias):
def __getitem__(self, key):
def __setitem__(self, key, value):
The only niggly worry I have is I'm not sure when hash can be used, when
-- Steven.Received on Thu Sep 29 16:59:52 2005 |