Closed CelestialGuru closed 1 year ago
The following works in every version of Python:
>>> class Foo:
... aa = 1
... def ab(self): pass
... ba = 2
... def bb(self): pass
...
>>> foo = Foo()
>>> foo.
Pressing [TAB]:
foo.aa foo.ab() foo.ba foo.bb()
>>> foo.
I even tried building synthetic classes which have many attributes:
>>> import itertools, string
>>> Foo = type("Foo", (), {name:lambda self:1 for name in list(map("".join, itertools.product(*[string.ascii_lowercase]*3)))})
>>> foo = Foo()
>>> foo.
Press [TAB]
... thousands of results (17,576 to be exact) show up but I've hidden them for brevity's sake
>>> foo.
So it's not even that newer versions of Python are hiding them if there's too many.
So, why is it that fake. [TAB]
shows nothing in newer versions of Python but only does in older versions?
This has already been reported in the past: https://github.com/joke2k/faker/issues/1604
The issue was closed. Should I attempt to reopen #1604, or is creating this new issue the correct course of action?
You should reopen #1604. I'm closing this one as duplicate
Setup:
Now type [TAB] once or twice.
If you are using Python 3.8, you will see:
If you are using Python 3.9, 3.10, or 3.11, you will see: Nothing. Nothing happens when you hit [TAB] after typing
fake.
This is Python saying it should work: https://docs.python.org/3.11/tutorial/interactive.html#tab-completion-and-history-editing. (Docs here are the same in all versions of Python)