mhammond / pywin32

Python for Windows (pywin32) Extensions
4.9k stars 783 forks source link

pyright turn on reportOptionalCall #2285

Open Avasam opened 3 weeks ago

Avasam commented 3 weeks ago

Letting type checkers know that self.myInvokeMethod = None shouldn't mean that myInvokeMethod could be None in normal circumstances (a closed EventSink shouldn't be used anymore).

Although maybe there's a better way of releasing resources? (like del, or assigning a default method that throws an error indicating that the object is already closed)