[Python-ideas] PEP 3156: getting the socket or peer name from the transport

Guido van Rossum guido at python.org
Mon Jan 28 16:45:55 CET 2013


On Mon, Jan 28, 2013 at 12:57 AM, Shane Green <shane at umbrellacode.com> wrote:
> What about giving the protocol an environ info object that should have all
> information it needs already, which could (and probably should) include
> things like the SSL certificate information, and would probably also be
> where additional info that happened to be looked up, like host name details,
> was stored and accessed.  Assuming the transports, etc., can define all the
> state information a protocol needs, can operate without hardware
> dependencies; in case that doesn't happen, though, the state dict will also
> have references to the socket, so the protocol could get to directly if
> needed.

Hm. I'm not keen on precomputing all of that, since most protocols
won't need it, and the cost add up. This is not WSGI. The protocol has
the transport object and can ask it specific questions -- if through a
general API, like get_extra_info(key, [default]).

-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list