def _getCachedValue(obj, relicFunc, resultType):
<EOL>if not obj.cached:<EOL><INDENT>obj.cached = resultType()<EOL>relicFunc(byref(obj.cached))<EOL><DEDENT>return obj.cached<EOL>
Retrieves a value from obj.cached (if not None) or calls @relicFunc and 
caches the result (of @resultType) int obj.cached.

This is a common implementation for orderG1/G2/Gt and generatotG1/G2/Gt