Skip to content

Instantly share code, notes, and snippets.

@msakai
Created February 3, 2020 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msakai/c1191c8fedea3396056de1a04841213f to your computer and use it in GitHub Desktop.
Save msakai/c1191c8fedea3396056de1a04841213f to your computer and use it in GitHub Desktop.
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