Repository navigation
Philippe/python stacks in js - #286
Merged
Merged
Conversation
Collaborator
|
excitement |
Contributor
Author
|
Known Windows CI temporary issues |
philippedistributive
requested review from
wesgarland and
zollqir
and removed request for
zollqir
March 13, 2024 20:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Provide full Python stack trace details when in a JS context
closes #270
We still have cases where the stack is missing:
due to not having entered the python function at all: we can't get into its code because we can't properly give it args to run with
So this one can generate a stack for us:
items = [4,2,6,7]
def myFunc(e,f):
return len(e) - len(f)
pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc)
-> object of type 'float' has no len() (edited)
but these two can't:
items = ['Four', 'Three', 'One']
def myFunc(e):
return len(e)
pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, myFunc)
-> takes 1 positional argument but 2 were given
items = ['Four', 'Three', 'One']
pm.eval("(arr, compareFun) => {arr.sort(compareFun)}")(items, len)
-> len() takes exactly one argument (2 given)
but then the error message is rather revealing and gives us a direction to work into