What is __return__?

前端 未结 3 1553
失恋的感觉
失恋的感觉 2020-12-29 08:13

I am debugging a script in Python 3.1 and discovered this:

(Pdb) p locals() {\'count\': 264, \'self\': , \'depth\': 1, \'offset\': 0, \'_

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 08:38

    It's a common or garden local name, possibly a name for a function or a value, as you can tell from the fact that its name is in locals(). You would need to look at the code that defines it to see what it's used for. The fact that it starts with a double-underscore hints that it is a special value of some sort; perhaps it's used to hold the return value for some function. However, Python itself does not give any special meaning to the name __return__, so it could really be anything.

    Knowing where you found it would be a nice start...

提交回复
热议问题