Commits

coady committed e60dd69

Test coverage and documentation update.

Comments (0)

Files changed (5)

+syntax: glob
+*.pyc
+992be14b170ad7b68ae1210227f255d434bfc10b v0.1
+832847bf0acf65e4b0024fe6cde12cfe36a417d5 v0.2
+a1ddf3bee3ffd015675a027eb76aa2819beb5d9a v0.2.1
 """
-Multiple argument dispacthing.
+**Multiple argument dispatching**
 
-Call multimethod on a variable number of types.
+Call *multimethod* on a variable number of types.
 It returns a decorator which finds the multimethod of the same name,
-creating it if necessary, and adds that function to it.  For example:
+creating it if necessary, and adds that function to it.
+For example::
 
     @multimethod(*types)
     def func(*args):
-        ...
+        pass
 
-'func' is now a multimethod which will delegate to the above function,
+|
+
+*func* is now a multimethod which will delegate to the above function,
 when called with arguments of the specified types.  If an exact match
 can't be found, the next closest method will be called (and cached).
 A function can have more than one multimethod decorator.
 
 See tests for more example usage.
-Supported on Python 2.5 or higher, including Python 3.x.
+Supported on Python 2.5 or higher, including Python 3.
 """
 
 import sys
 from distutils.core import setup
+import multimethod
 
 setup(
     name='multimethod',
-    version='0.2.1',
+    version='0.2.1+',
     description='Multiple argument dispacthing.',
-    long_description=open('multimethod.py').read().split('"""\n')[1],
+    long_description=multimethod.__doc__,
     author='Aric Coady',
     author_email='aric.coady@gmail.com',
+    url='https://bitbucket.org/coady/multimethod',
     py_modules=['multimethod'],
     classifiers=[
-        'Development Status :: 4 - Beta',
+        'Development Status :: 5 - Production/Stable',
+        'Intended Audience :: Developers',
         'License :: OSI Approved :: Python Software Foundation License',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.5',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.1',
+        'Programming Language :: Python :: 3.2',
+        'Topic :: Software Development :: Libraries :: Python Modules',
     ],
 )
 class scissors(object):
     pass
 
-@multimethod(object, object)
-def roshambo(left, right):
-    return 'tie'
-
 @multimethod(scissors, rock)
 @multimethod(rock, scissors)
 def roshambo(left, right):
 def roshambo(left, right):
     return 'paper covers rock'
 
+@multimethod(object, object)
+def roshambo(left, right):
+    return 'tie'
+
 # string join
 class tree(list):
     def walk(self):
         assert roshambo(r, r) == 'tie'
         assert roshambo.cache
         del roshambo[object, object]
-        assert len(roshambo) == 6 and not roshambo.cache
+        del roshambo[rock, paper]
+        assert len(roshambo) == 5 and not roshambo.cache
         self.assertRaises(TypeError, roshambo, r, r)
 
     def testJoin(self):