Python Forum

Full Version: Hex code in a traceback
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What does the hex code in a Python traceback mean?

For example, the following traceback is from accessing an out of bounds list index:

In [19]: c[100]
-------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-18-9a31ea1e1a13> in <module>()
----> 1 c[100]

IndexError: list index out of range

What is "9a31ea1e1a13"?
Please, post the entire traceback that you get. We need to see the whole thing. Do not just give us the one/last line. Take a time to read What to include in a post
If you post your code in code tags would also help
(Oct-13-2017, 03:36 PM)insearchofanswers87 Wrote: [ -> ]What is "9a31ea1e1a13"?
It's a internal generated number bye IPython,so has nothing to about the code.
So just ignore it.
In [1]: l = [1,2,3]
In [2]: l[2]
Out[2]: 3

In [3]: l[3]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-3-bb49eeb9f0db> in <module>()
----> 1 l[3]

IndexError: list index out of range
@buran Thanks for responding. That is the entire traceback. This is from an IPython interactive session.

I know that this is some sort of internal IPython generated hex value. I am just trying to understand it's purpose. I need to teach this to beginning programmers--they'll choke when they see something like that.
I guess is this.
Top-level structure
"signature": "hex-digest", # used for authenticating unsafe outputs on load
I don't think that's it snippsat.
insearchofanswers87 Wrote:I don't think that's it snippsat.
Maybe not,ask on question on repo there they know.
(Oct-14-2017, 03:25 PM)insearchofanswers87 Wrote: [ -> ]I am just trying to understand it's purpose. I need to teach this to beginning programmers--they'll choke when they see something like that.
I can not understand why it should be problem to tell that it's auto generated internal message of IPython,
that has nothing to do about the code they writing,so just ignore it.