[Twisted-Python] Converting async to sync code (blocking until deferreds fire)

glyph at divmod.com glyph at divmod.com
Tue Jul 22 14:08:25 EDT 2008


On 02:22 pm, jack-tp at cs.york.ac.uk wrote:
>2. Trial _wait
>   twisted.trial.unittest has a _wait method which is used by some
>   tests to wait for deferreds to fire. However, the only clean
>   way to use this _wait method is to write a test case! If this
>   were C++ or Java, this method would be "private" - it's only
>   externally accessible because Python doesn't have "private".

There is no "clean" way to use this method.  The "_" denotes that it 
*is* "private".  Python won't prevent you from accessing it, but we will 
;).  Your program is almost guaranteed to break when you upgrade Twisted 
if you use features which we have specifically said are not for public 
use.




More information about the Twisted-Python mailing list