You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is the intended behavior {1:2,4:5}[6] in regular python will give something like
Traceback (most recent call last):
<traceback here ...>
KeyError: 6
While calling python through tohil will produce
'6' (error in python object call)
from python code executed by tohil
<tracback here ...>
That '6' may be quite confusing, and potentially important information is lost about the exception (the fact that it's a keyerror). Since this behavior works fine and makes sense for some cases like say ZeroDivisionError: division by zero -> division by zero, I don't know if it is indeed intended. However, even tcl's own dict get {1 2} 3 won't just say 3, rather key "3" not known in dictionary.
Would it be ok to make tohil return the exception class name along the description?
The text was updated successfully, but these errors were encountered:
Would a PR changing the behavior to smth like KeyError 6 be accepted? Tests would have to be updated and I don't think backwards compatibility would be possible
Not sure if this is the intended behavior
{1:2,4:5}[6]
in regular python will give something likeWhile calling python through tohil will produce
That '6' may be quite confusing, and potentially important information is lost about the exception (the fact that it's a keyerror). Since this behavior works fine and makes sense for some cases like say
ZeroDivisionError: division by zero
->division by zero
, I don't know if it is indeed intended. However, even tcl's owndict get {1 2} 3
won't just say3
, ratherkey "3" not known in dictionary
.Would it be ok to make tohil return the exception class name along the description?
The text was updated successfully, but these errors were encountered: