- Copy these lines into a Python REPL
# ---8<---
class Wat:
@property
def wat(self):
print("\n...wat...\n...wat!?\n\n ?!?!\n\n")
return 42
a = Wat()
# --->8---
- Now, type
a.
, as if you were about to access some attribute ofa
. You should be seeing something like this:
>>> class Wat:
... @property
... def wat(self):
... print("\n...wat...\n...wat!?\n\n ?!?!\n\n")
... return 42
...
>>> a = Wat()
>>> a.
- PRESS TAB
- ???
- PRESS TAB AGAIN
- ?!?!?!
- https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/Lib/rlcompleter.py#L173
- https://github.com/python/cpython/commit/4118174315f4cba03208886af868fe31f1cd5b9d
- https://mail.python.org/pipermail/python-checkins/2008-July/071402.html
- https://bugs.python.org/issue449227
- https://docs.python.org/3/library/inspect.html#fetching-attributes-statically
- https://bugs.python.org/issue29630
- python/cpython#248
Not a bug!