refactor: use native types over `typing` and remove `eval`s
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
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
```py
_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")))
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to runtime type resolution using mapped_array_type and array_of; start by tracing how these values are handled during deserialization. Replace the typing and eval-based path with native runtime types, then verify JSON and XML serialization and deserialization still behave correctly without eval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, security
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100