Re: [Twisted-Python] twistedchecker now uses pylint >= 2.4.4, can we use type annotations in Twisted now?

2020-06-16 Thread Glyph
Awesome, thanks for doing this work Craig, Adi, and Wilfredo! -g > On Jun 15, 2020, at 8:32 PM, Craig Rodrigues wrote: > > Thanks to Adi and Wilfredo who have reviewed my PR's. Currently in trunk, I > have eliminated hundreds of mypy > errors through a combination of trivial fixes to code, ad

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Glyph
> On Jun 15, 2020, at 8:43 PM, Craig Rodrigues wrote: > > In twisted.internet.abstract.FileDescriptor.loseConnection, the > loseConnection method > is defined like: > > def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): I think this signature might just be... wron

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Maarten ter Huurne
On Tuesday, 16 June 2020 10:51:21 CEST Glyph wrote: > > On Jun 15, 2020, at 8:43 PM, Craig Rodrigues > > wrote: > > > > In twisted.internet.abstract.FileDescriptor.loseConnection, the > > loseConnection method> > > is defined like: > > def loseConnection(self, _connDone=failure.Failure(main

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Patrick Cloke
On 6/15/20 11:43 PM, Craig Rodrigues wrote: In twisted.internet.abstract.FileDescriptor.loseConnection, the loseConnection method is defined like:     def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): while in twisted.internet._newtls.ConnectionMixin , we have:   d

Re: [Twisted-Python] Question about FileDescriptor.loseConnection() signature found by mypy

2020-06-16 Thread Craig Rodrigues
twisted.internet.abstract.FileDescriptor.loseConnection() was changed here in 2004: https://github.com/twisted/twisted/commit/081d393ab03da92d744d8fb2b5d77705662a0caa This change was done so long ago, but I think changing the signature like that was wrong. I took a guess at how to fix this and su

[Twisted-Python] mypy: class ThreadPool has workers redefined

2020-06-16 Thread Craig Rodrigues
While looking at these mypy logs: https://dev.azure.com/twistedmatrix/twisted/_build/results?buildId=1904&view=logs&j=d78da089-4bf6-58fe-28a5-46635fd5b8d1&t=45ce7910-c28c-5e9a-4ee7-e041d314a5fc I found an interesting one: src/twisted/python/threadpool.py:84:6: error: Name 'workers' already defin