Closed eduard93 closed 5 years ago
import random
import inspect
classes = inspect.getmembers(random, inspect.isclass)
tree = inspect.getclasstree([cls[1] for cls in classes], 1)
tree
https://docs.python.org/3/library/inspect.html#inspect.getclasstree
Currently failing:
_urandom
args...
Signature: (size, /)Maybe try to parse signature if explicit arguments fail? Or provide args?
Options:
Need better method/classmethod detection
Problems so far:
[ ] feedparser tensorflow - class name/attribute issue. But they compile OK. (https://stackoverflow.com/questions/55561806/how-to-get-a-class-object-from-class-name)
[x] pkg_resources
ERROR #5001: code: zzzjson=json.dumps(zzzargs, default=zzztoserializable, allow_nan=True), variable: , serialization: 0, result:
ERROR #5001: ['Traceback (most recent call last):
', ' File "<string>", line 1, in <module>
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\__init__.py", line 238, in dumps
**kw).encode(obj)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
', 'ValueError: Circular reference detected
[ ] wave aifc
2019-04-04 19:47:07 Generating type: wave.Wave_write
ERROR #5093: Name conflict on class 'py.wave.Wave.write' because package 'py.wave.wave' has the same name but differs in case.
[ ] ast
ERROR #5092: Name conflict on class 'py.ast.UnaryOp' because class 'py.ast.unaryop' has the same name but differs in case.
[ ] hashlib
2019-04-07 17:55:50 Generating type: _sha3.shake_256
ERROR #5802: Datatype validation failed on property '%Dictionary.ClassDefinition:IsValid', with value equal to "py.sha3.shake.256"
[ ] setuptools
ERROR #5316: Class dependency loop for classes 'py.distutils.extension.Extension,py.setuptools.extension.Extension'
[ ] six
2019-04-07 19:24:14 Generating type: six._MovedItems
ERROR #5001: code: zzzmembers = zzzgetmembers(six._MovedItems, callable), variable: zzzmembers, serialization: 0, result:
ERROR #5001: ['Traceback (most recent call last):
', ' File "<string>", line 1, in <module>
', ' File "<string>", line 2, in zzzgetmembers
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\inspect.py", line 342, in getmembers
value = getattr(object, key)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 92, in __get__
result = self._resolve()
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 115, in _resolve
return _import_module(self.mod)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 82, in _import_module
__import__(name)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\dbm\gnu.py", line 3, in <module>
from _gdbm import *
', "ModuleNotFoundError: No module named '_gdbm'
[x] astor botocore
ERROR #5001: code: zzzjson=json.dumps(zzzargs, default=zzztoserializable), variable: , serialization: 0, result:
ERROR #5001: ['Traceback (most recent call last):
', ' File "<string>", line 1, in <module>
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\__init__.py", line 238, in dumps
**kw).encode(obj)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
', ' File "C:\Users\eduard\AppData\Local\Programs\Python\Python36\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
', 'TypeError: keys must be a string
']
[x] ssl
2019-04-07 19:33:17 Generating type: ssl.SSLContext
ERROR #5001: code: import <unknown>
Can datatype redefine getter?
s str2=##class(py.builtins.str).%New(,"str2","'dvd'")
s bytes=str2.encode() <-fail
s sc = ##class(isc.py.Main).ImportModule("zlib")
write ##class(py.zlib).crc32(bytes)
write ##class(py.zlib).crc32("b'dvd'")
write ##class(py.zlib).crc32("b'dvd'")
2200289759
PYTHON>w $ZCRC("dvd",7)
Closed.
Open releated issues on individual basis.
Import selected modules/classes/functions and generate ObjectScript classes and methods to call python.
Complete proxy gateway would be great to have but I'm not sure how much time it would take to implement. I'll research at least the scope of the project. Issues: