Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import Pyro4
import inspect
@Pyro4.expose
class C:
def m(self):
return 0
print(Pyro4.util.get_exposed_members(C()))
# => {'methods': set(), 'oneway': set(), 'attrs': set()}
print(C.m)
# => <cyfunction C.m at 0x10f954d38>
print(type(C.m))
# => <class 'cython_function_or_method'>
print(inspect.isfunction(C.m))
# => False
print(inspect.ismethod(C.m))
# => False
print(inspect.ismethoddescriptor(C.m))
# => True
import cython_pyro4_test
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
ext_modules = cythonize([
Extension("cython_pyro4_test", ["cython_pyro4_test.pyx"]),
], language_level=3)
setup(
name='cython_pyro4_test',
ext_modules=ext_modules,
zip_safe=False,
requires=["Pyro4", "Cython"],
setup_requires=["Cython"],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment