[Bf-python] Hashing Vectors

Martin Poirier theeth at yahoo.com
Tue Jul 18 15:10:27 CEST 2006



--- Campbell Barton <cbarton at metavr.com> wrote:

> Yep, at the moment Im making a tuple from them, it
> just seems like it 
> could be slow - hashing vectors directly was about
> 17 times faster.
> So I agree that tuple() on vectors is the most
> correct way, but Id like 
> a faster way and hashing a vector based on its
> location seems ok..

It is definitly NOT ok to use mutable objects for
dictionary keys.

Regardless of speed issues, it is NOT an acceptable
solution.

The only acceptable solution for making vectors and
matrices hashable is to make them immutable (which
would be impossible for wrapped values).

Martin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bf-python mailing list