Files
secondo/apis/python2/SecondoAPI/.ipynb_checkpoints/Generalobjects-checkpoint.ipynb
2026-01-23 17:03:45 +08:00

63 lines
1.7 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"#equivalent of MemoryObjects.java\n",
"import import_ipynb\n",
"\n",
"from GeneralType import *\n",
"\n",
"class Generalobjects(ABC):\n",
" class PyObject(enum.Enum):\n",
" Relation = \"TypeRelation\" \n",
" Tuple = \"TypeTuple\" \n",
" GeneralType = \"GeneralType\"\n",
"\n",
" def getTypeName(self, typeClass):\n",
" if issubclass(self.__class__,cls_name[key]):\n",
" return GenaralType.getTypeName(typeClass)\n",
" for obj in PyObject:\n",
" #+++need to change, string to class\n",
" if issubclass(typeClass, obj.value):\n",
" return str(obj.name)\n",
" return\n",
" def getTypeClass(typeName):\n",
" if typeName in GeneralType.getAllTypeNames():\n",
" return GeneralType.getTypeClass(typeName)\n",
"\n",
" for obj in PyObject:\n",
" if str(obj.name) == typeName:\n",
" #+++need to change string to class\n",
" return obj.value\n",
"\n",
" return\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}