PyCharm strange behaviour while working with matplotlib
Matplotlib.org says that matplolib.pyplot.figure() return type is "Figure" and it's quite logical. But for some reason PyCharm defines it as "Any". So IDE doesn't know that "fig" is an instance of class "Figure". This causes some problems for me. For example, I can't get autocompleting.


Of course I can add type annotation manually, but it's not very convenient.
P.S. It's interesting that Visual Studio Code works correctly in this situation.


How can I fix it? I feel like I'm missing something obvious.
Please sign in to leave a comment.
Hi,
Unfortunately, it's a known issue. Please use a workaround by adding annotation manually if it's possible.