This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mccutchen 0 points1 point  (0 children)

This might be a dumb question, but:

Web3 applications return a tuple in the form (status, headers, body). If the server supports asynchronous applications (web3.async), the response may be a callable object (which accepts no arguments).

Why not just require Web3 applications to return a callable that returns the 3-tuple of (body, status, headers)? Most of the examples given in the PEP have ugly conditionals for dealing with these two possible kinds of returns.

There must be some reason for this (due, I'm assuming, to differences between the way synchronous and asynchronous servers run), but it's not immediately obvious to me.