我偶然发现了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
。那究竟是什么呢,它是否特定于某些贝壳?