[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: This has come up several times in the past and never moved forward. Part of the reason is that the mapping API doesn't translate cleanly to bidirectional lookups and it leaves users trapped if two keys every end up needing to be mapped to the same value

[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-17 Thread Vedran Čačić
Vedran Čačić added the comment: Your implementation has many problems. First, almost all your complexity claims are wrong, probably because you copied them from Java, which uses balanced trees instead of Python's hash tables. (Also, the method names seem to be copied from Java, using camelCase

[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-17 Thread Jurjen N.E. Bos
Jurjen N.E. Bos added the comment: It is part of the Apache Common collections -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is BiDiMap included in the Java SDK? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Pyth

[issue44931] Add "bidimap" to collections library: a simple bidirectional map

2021-08-16 Thread Jurjen N.E. Bos
Change by Jurjen N.E. Bos : -- title: Add "bidimap" to collections library -> Add "bidimap" to collections library: a simple bidirectional map ___ Python tracker ___ _

[issue44931] Add "bidimap" to collections library

2021-08-16 Thread Jurjen N.E. Bos
Jurjen N.E. Bos added the comment: Give me a shout if you like this: I am happy to write a test suite, make a patch, etc. -- ___ Python tracker ___ __

[issue44931] Add "bidimap" to collections library

2021-08-16 Thread Jurjen N.E. Bos
Change by Jurjen N.E. Bos : -- type: -> performance versions: +Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44931] Add "bidimap" to collections library

2021-08-16 Thread Jurjen N.E. Bos
New submission from Jurjen N.E. Bos : The Java class "BiDiMap" is very useful and doesn't seem to have an equivalent in the Python libraries. I wrote a proposed class that does just that. Here's a simple implementation, that could be used as a starting point. -- files: bidimap.py hgrep