Home Download Buy Blog Forum Support

Region hashes

Region hashes

Postby adzenith on Sun Dec 04, 2011 8:28 pm

If two regions are identical, could they hash the same? This would greatly simplify my life, as right now I have to convert Regions to tuples before adding them to a set, and then convert them back to Regions before using them.

Code: Select all
>>> a = sublime.Region(1)
>>> b = sublime.Region(1)
>>> a == b
True
>>> a.__hash__()
4598902288
>>> b.__hash__()
4598902200
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests