Two different values for same variable “args”

耗尽温柔 提交于 2019-12-01 06:19:42

args is a PDB debugger command. Use !args to show the actual variable.

See the Debugger Commands section:

a(rgs)
Print the argument list of the current function.

and

[!]statement
Execute the (one-line) statement in the context of the current stack frame. The exclamation point can be omitted unless the first word of the statement resembles a debugger command.

(Emphasis mine).

In your args output you can see the args argument value on the first line.

Personally, I find the (a)rgs command a little pointless; it prints all values using str() instead of repr(); this makes the difference between objects with similar __str__ output values invisible (such as str vs. unicode, or a BeautifulSoup Element vs. a string with HTML, etc.).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!