How do I properly type a class within itself? In PyCharm I am currently getting this error:
This is an unresolved reference error. This normally makes sense because I wouldn't expect PyCharm to support types perfectly. However, when I use it in other classes besides the Item
class itself there is no error:
Thus I believe that the error only appears when the type hint is supplied within its own class. So I don't know what exactly to do to prevent this error or if I am using types wrong in general and a type shouldn't be used within itself.
Basically the behavior I am trying to emulate is that you have a crafting recipe for an item and can create new instances of that item with the recipe function.