Created
February 3, 2020 01:31
-
-
Save msakai/c1191c8fedea3396056de1a04841213f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cython_pyro4_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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