[EMAIL PROTECTED] wrote:
A google search for biject.py and bijection.py
produced no hits, so I suspect that this may not
have been done before.
There are few (good too) implementations around, but they are called
bidict or bidirectional dicts. Sometimes I use this implementation,
with few
Hello
As part of the MathTran project I found myself
wanting to maintain a bijection between long
names and short names.
http://www.open.ac.uk/mathtran
In other words, I wanted to have two dictionaries
f and g such that
f[a] == b
g[b] == a
are equivalent statements.
A google search for
On Feb 6, 5:22 am, Jonathan Fine [EMAIL PROTECTED] wrote:
Hello
As part of the MathTran project I found myself
wanting to maintain a bijection between long
names and short names.
http://www.open.ac.uk/mathtran
In other words, I wanted to have two dictionaries
f and g such that
f[a]
Nick Vatamaniuc wrote:
If you need to get a short name, given a long name or vice-verse _and_
the set of short names and long names is distinct (it would be
confusing if it wasn't!) then you can just have one dictionary, no
need to complicate things too much:
f[a]=b
f[b]=a
You won't know
Jonathan Fine:
A google search for biject.py and bijection.py
produced no hits, so I suspect that this may not
have been done before.
There are few (good too) implementations around, but they are called
bidict or bidirectional dicts. Sometimes I use this implementation,
with few changes: