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

Dynamically create NamedTuple objects #2

Open
mrapacz opened this issue Apr 4, 2020 · 0 comments
Open

Dynamically create NamedTuple objects #2

mrapacz opened this issue Apr 4, 2020 · 0 comments
Labels
enhancement New feature or request
Projects

Comments

@mrapacz
Copy link
Owner

mrapacz commented Apr 4, 2020

We could provide the users with an option to acquire the generated NamedTuple class objects on the fly, instead of returning strings with Python code, which need to be interpreterd.
This could be achieved in multiple ways:

  • leveraging NamedTuple code (probably involves the most work, should be fastest performance-wise and safest(?))
  • using ast to parse the code and then eval? (seems quite hacky)
  • dynamically creating a Python module, which can then be imported using importlib - similar to how the current end-to-end tests are doing that in the package - this could be slower due to I/O operations, kinda eval-ish, but simplest in implementation (since we already have a working mvp)
@mrapacz mrapacz created this issue from a note in ntgen (To do) Apr 4, 2020
@mrapacz mrapacz added the enhancement New feature or request label Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
ntgen
  
To do
Development

No branches or pull requests

1 participant