On Mon, Jan 28, 2013 at 5:45 PM, Guido van Rossum <guido@python.org> wrote:
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]).


I forgot to ask before, but why is get_extra_info better than normal attributes and methods?

val = transport.get_extra_info(key, None)
if val is None:
    pass

# vs

if hasattr(transport, key):
    val = transport.key
else:
    pass



Yuval