Problems with new type settings of version 5
In the new version 5, there are some very nice features coming as far as I can tell. However, importing the new Client results in an error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-3-d5185e459cbe> in <module>
----> 1 from coscine import Client
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/__init__.py in <module>
12 ###############################################################################
13
---> 14 from .client import Client
15 from .project import Project
16 from .resource import Resource
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/client.py in <module>
27 from .about import __version__
28 from .exceptions import *
---> 29 from .project import Project
30 from .static import StaticServer
31 from .ProjectForm import ProjectForm
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/project.py in <module>
20 import json
21 from .exceptions import *
---> 22 from .resource import Resource
23 from .ResourceForm import ResourceForm
24 from .ProjectForm import ProjectForm
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/resource.py in <module>
22 from .exceptions import *
23 from .object import Object
---> 24 from .MetadataForm import MetadataForm
25 from .MetadataPresetForm import MetadataPresetForm
26 from .ResourceForm import ResourceForm
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/MetadataForm.py in <module>
13
14 from .exceptions import *
---> 15 from .form import Form
16
17 ###############################################################################
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/form.py in <module>
17 ###############################################################################
18
---> 19 class Form(MutableMapping):
20
21 # Form flags
/mnt/c/Users/Siemer/pyiron_git/other_git_repos/coscine-api-python-client/src/coscine/form.py in Form()
142 ###############################################################################
143
--> 144 def keys(self) -> list[str]:
145 return self._keys.keys()
146
TypeError: 'type' object is not subscriptable
As far as I can tell, there are some new definitions of output types causing the problem. While it is intended to have a 'list of strings' as output type here, python tries to subscript the type list
with the type str
.
I found such definitions e.g. in
-
project.py
lines 44, 45, 84, 126, -
resource.py
line 102 -
client.py
lines 53, 109