<分区>
我在 Python decorator to keep signature and user defined attribute 中偶然发现了以下语法:
> def func():
... return "Hello World!"
...
> func?
Signature: func()
Docstring: <no docstring>
File: ~/<ipython-input-8-934f46134434>
Type: function
在我的 Python Shell 中尝试相同的操作,无论是 2 还是 3,都只会引发 SyntaxError
。那么这到底是什么,是否特定于某些 shell?