Skip to content

Added call_or_unsupported to vm.rs #197

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

Merged

Conversation

BojanKogoj
Copy link
Contributor

This is to prevent code duplication. Based on #188

@BojanKogoj
Copy link
Contributor Author

How to write tests to make sure this is working correctly? I would need to catch exception

@windelbouwman
Copy link
Contributor

You could write rust unit tests, but in this case it might be better to write a python test snippet which catches the exception and tests if the proper exception is raised. You could use try-except-else for this, like is done here: https://github.com/RustPython/RustPython/blob/master/tests/snippets/builtin_hex.py

@windelbouwman windelbouwman merged commit a17fb3f into RustPython:master Nov 17, 2018
@BojanKogoj BojanKogoj changed the title WIP: Added call_or_unsupported to vm.rs Added call_or_unsupported to vm.rs Nov 17, 2018
@cthulahoops
Copy link
Collaborator

Sorry about being slow to respond to this.

I'd prefer to see this named something like apply_operator. I'd probably give d and r names like lhs_method_name and rhs_method_name.

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

Successfully merging this pull request may close these issues.

3 participants