[Twisted-Python] Twisted 21.7.0 Pre-Release Announcement

Barry Scott barry.scott at forcepoint.com
Thu Jul 15 10:22:40 MDT 2021


On Thursday, 15 July 2021 17:00:06 BST Richard van der Hoff wrote:
> On 11/07/2021 00:49, Glyph wrote:
> > Thank you Adi!  Very glad to see us collectively getting back on the 
> > release-management horse again!  And it was super encouraging to see 
> > how quickly you were able to get this out, with all the automation 
> > that everyone (not least of all yourself) has been building to make 
> > this process faster and simpler.
> >
> To echo this: thank you for your work, Adi!
> 
> > It appears we've buried the lede on one of our biggest features in 
> > this release though - 
> > https://github.com/twisted/twisted/pull/1448/files 
> > <https://github.com/twisted/twisted/pull/1448/files> had no newsfile 
> > that shows up in the changelog, but it properly made Deferred into a 
> > generic, so I think this is the first release of Twisted where you 
> > might /reasonably/ be able to use mypy without your own custom stub 
> > files! :)
> 
> This looks very cool, but presents us with a problem.
> 
> mypy now complains about instantiations of Deferred without a type 
> annotation:
> 
>  > d = defer.Deferred()
> 
> results in an error:
> 
>  > synapse/util/async_helpers.py:124: error: Need type annotation for 
> 'd'  [var-annotated]
> 
> We can't just go and add type annotations because we need to maintain 
> compatibility with older Twisted (to make it possible to package in 
> Debian et al).
> 
> Any suggestions for keeping mypy happy?

What is the minimum version of Python 3 that is supported?
Does that minimum versions not have the typing feature that is used?

Also I thought that mypy could imply the type of d from the assignment.
Or is that that it could later...

Disclaimer, my mypy use is not that deep yet.

Barry





More information about the Twisted-Python mailing list