On Jul 25, 2013, at 6:51 PM, Matt Haggard <haggar...@gmail.com> wrote:

> I have a few thoughts:
> 
> First, how does this hypothetical system for specifying return types solve 
> the original problem (that user-written methods on TestCase pass unexpectedly 
> when a non-Deferred is returned)?  If I'm the one writing test_whatever, with 
> the proposed doc string method for specifying return type, then wouldn't I 
> need to write a docstring that specifies the return type as Deferred?
> 
All of this follows quite obviously if you just consider that a functional 
specification document (in other words, the generalization of the docstring) is 
simply a partial bijective homomorphism over the orbifold of possible runtime 
states (into the Hilbert space with a boundary defined by the NxM coordinate 
matrix of all possible intersections of sets of bugs and non-bugs of course).
> Second, I don't love the idea of the docstring changing how a function 
> behaves... I like that it's a free form blob of text.  I think I'd rather see 
> decorators used for this purpose.
> 
It's not so much changing how the function behaves but rather what its behavior 
is.

In any case, there's a great paper which offers an excellent theoretical 
background that should explain what I mean by that distinction, and should 
really elucidate some of the other threads in this conversation as well: 
<http://isotropic.org/papers/chicken.pdf>

Hope that clears things up,

-glyph


_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to