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

Get rid of converter logic #343

Open
2 tasks
filipsch opened this issue Sep 6, 2018 · 0 comments
Open
2 tasks

Get rid of converter logic #343

filipsch opened this issue Sep 6, 2018 · 0 comments

Comments

@filipsch
Copy link
Contributor

filipsch commented Sep 6, 2018

Back in the days, we coded in the ability to define 'converters', functions that are executed on a value before fetching the value from the process, for values that could not be dilled/pickled.

Now, has_equal_value() has the expr_code argument, that allows you to execute arbitrary code, and the func argument, that executes a function on the value before fetching it from the process. This is easier to understand and more elegant.

We should get rid of the former and advocate the latter. There are currently 18 exercises in production that use the converter logic, divided over two courses:

Things to do:

  • rewrite the SCTs (not fun, but shouldn't take long)
  • get rid of the set_converter() functionality.

If we really want to clean things up, we could also get rid of the converters that are 'baked into' pythonwhat, under pythownhat/converters.py. This will probably require us to rewrite even more SCTs, but it would help in keeping the codebase of pythonwhat a little cleaner and easier to understand.

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

No branches or pull requests

1 participant