It may help to think separately about existing code using ssl, and about
new code. However, I'm not a user of ssl, so please doubt my opinions below.

EXISTING CODE
Those maintaining existing code might welcome an easy way of checking that
the code doesn't have a misleading assignment. They might also appreciate a
quick fix, such as using a subclass of type(context) that does have
__slots__. (Such devices might not work well with all existing code.)

NEW CODE
Those creating new code might appreciate a new API that has been redesigned
to simplify the interface and better support security audits. For example:

    >>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
    >>> context
    <ssl.SSLContext object at 0x7f3c7d357fa8>

Perhaps better is that type(context).__repr__ show the attributes of the
context object (and anything inherited from the parent class).

BITWISE OPERATIONS
Also, the sample code (in docs ssl.html)

    ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)
    ctx.options &= ~ssl.OP_NO_SSLv3

contains bitwise operations whose meaning requires some thought.
-- 
Jonathan
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/E5JEVSXRNDZF3AUH7XZZ5XXXJE4JNIDU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to