When I trace to a function, inside the function I would like to print the values of those variable names with underscore in the beginning, eg. p __seqLen
. It keeps showing AttributeError: AttributeError("Converter instance has no attribute '__seqLen'",)
I also tried to use p self.__seqLen
. This is also not working. How can I print those values?
p locals()
p globals()
could help.
You might be running into Python's private name mangling. Python will mangle identifiers that begin with two or more underscores and do not end with two or more underscores. It transforms __somename
into _Class__somename
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With