Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made version hashable

  • Loading branch information...
commit 9c80ab0638438c0385142c6fc01626e684e28925 1 parent 6b5933f
@gfxmonk authored
Showing with 12 additions and 0 deletions.
  1. +8 −0 version.py
  2. +4 −0 version.xml
View
8 version.py
@@ -196,6 +196,14 @@ def __repr__(self):
def __nonzero__(self):
return self.number is not None
+ def __hash__(self):
+ """
+
+ >>> list(sorted(set(map(Version.parse, ("0.1", "0.2", "0.1")))))
+ [Version('0.1'), Version('0.2')]
+ """
+ return hash(self.number)
+
def prompt(msg):
if sys.stdin.isatty():
return raw_input(msg).strip().lower() in ('y','yes','')
View
4 version.xml
@@ -80,6 +80,10 @@ To increment the second-most minor version number
<arg>--exe</arg>
</runner>
</command>
+ <requires interface="http://repo.roscidus.com/python/python">
+ <version before="3"/>
+ </requires>
+
<environment insert="" mode="prepend" name="PYTHONPATH"/>
<implementation id="sha1new=bea229b667512d5b01b6b7f35919ca88ee95af50" released="2010-07-31" version="0.2">
<manifest-digest sha256="193941f6f9f61c35ea94156cfd1c8e52e25577ce3e23f89db0eead9120154a65"/>
Please sign in to comment.
Something went wrong with that request. Please try again.