Access co_kwonlyargcount with getattr function

The co_kwonlyargcount attribute does not exist on code objects in
Python2. Using getattr allows a default value of 0 to be specified.
Access __annotations__ with getattr function

The __annotations__ attribute on function objects does not exist in
Python2. Using getattr allows a default emtpty dictionary to be
specified.
Access __annotations__ with getattr function

The __annotations__ attribute on function objects does not exist in
Python2. Using getattr allows a default emtpty dictionary to be
specified.
Test for valid identifiers names with regex

Python2 string objects do not have as isidentifier method. This replaces
use of isidentifier with a regular expression match.
Define assertRaisesRegex is missong on TestCase

Early versions of unittest.TestCase had an assertRaisesRegexp method
which was later renamed assertRaisesRegex. If the TestCase object is
missing the assertRaisesRegex method then contructor will assign it as
assertRaisesRegexp.
Use OrderedDict over MappingProxyType in Python2

Python2 does not have a MappingProxyType. In Python2 a copy of the
internal OrderedDict is returned instead.
Ensure all classes are new style classes

Each class needs to explicitly inherit from Object or other new style
class as otherwise these would be old style classes in Python2.
Define __hash__ on expected unhashable classes

Python3 will make a class unhashable if it defines a __eq__ method but
not a __hash__ method. However, Python2 does not. This explicitly
defines __hash__ on classes that are intended to be unhashable that
raises TypeError.
Skip immutability test for SignatureObject on Py2

Python2 does not have a MappingProxyType so the Signature objects
parameters attribute can not be immutable. On Python2 this test needs to
be skipped.
Make callable classes compatible with Python2

Object methods are plain funcitons in Python3 but unbound methods in
Python2. The funciton object is im_func attribute of the unbound method.
This works around these differences.
Skip assignment of function to __wrapped__ attr

On Python3 the type of a function assigned to the __wrapped__ attribute
is a plain funciton, but on Python2 it's an unbound method. This result
in the first argument being ignore (typically self or cls) in Python2
but not Python3. This test is now skipped on Python2.
Rename tests for funcsigs to test for inspect

These unit tests are derived from Python's inspect modules tests. They
have been renamed so that bespoke tests can be created for funcsigs.
Add basic function signature tests

Test the basic funtionality for signatures of functions that should be
compatible with both Python2 and Python3. This should cover the majority
of use cases.