Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use native types over typing and remove evals #24

Open
jkowalleck opened this issue Sep 28, 2023 · 1 comment
Open

refactor: use native types over typing and remove evals #24

jkowalleck opened this issue Sep 28, 2023 · 1 comment
Labels

Comments

@jkowalleck
Copy link
Collaborator

jkowalleck commented Sep 28, 2023

that the f...

eval of List[FooBar]( ... ) instead of native list(...) ...
the typing has no value here, this is pure runtime! and it is not only unnecessary overhead.

is this really needed?

and the FooBar is not even imported in this context, the typing just makes no sense !!!1elf

        _ARRAY_TYPES = {'List': List, 'Set': Set, 'SortedSet': Set}
        _DEFAULT_XML_SEQUENCE = 100
        _SORTED_CONTAINERS_TYPES = {'SortedList': List, 'SortedSet': Set}


# ...

                            # Will load any class already loaded assuming fully qualified name
                            self._type_ = eval(f'{mapped_array_type}[{results.get("array_of")}]')
                            self._concrete_type = eval(str(results.get("array_of")))
@Siddhesh-Agarwal
Copy link

We can use list instead of typing.List for Python >= 3.10 but this library supports Python >= 3.7. so we cannot use list directly, but I believe the FooBar can be removed for good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants