Skip to content

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

@jkowalleck

Description

@jkowalleck

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")))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions