__all__ = ["generic"] |
__all__ = ["generic"] |
|
try: |
from types import ClassType, InstanceType |
from types import ClassType, InstanceType |
classtypes = type, ClassType |
classtypes = type, ClassType |
|
except ImportError: |
|
classtypes = type |
|
InstanceType = None |
|
|
def generic(func): |
def generic(func): |
"""Create a simple generic function""" |
"""Create a simple generic function""" |
return f |
return f |
return decorate |
return decorate |
|
|
|
|
|
|
|
|
_by_object = {} |
_by_object = {} |
_gbo = _by_object.get |
_gbo = _by_object.get |
|
|
optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, |
optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE, |
) |
) |
|
|
|
if __name__=='__main__': |
|
import unittest |
|
r = unittest.TextTestRunner() |
|
r.run(test_suite()) |
|
|
|
|
|
|