[issue28025] Use IntEnum and IntFlags in ssl module

2017-03-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: pending -> closed ___ Python tracker ___ _

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-09 Thread Christian Heimes
Changes by Christian Heimes : -- stage: patch review -> commit review status: open -> pending ___ Python tracker ___ ___ Python-bugs-l

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset c32e9f9b00f7 by Christian Heimes in branch 'default': Issue #28025: Convert all ssl module constants to IntEnum and IntFlags. https://hg.python.org/cpython/rev/c32e9f9b00f7 -- nosy: +python-dev ___ Python

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Christian Heimes
Christian Heimes added the comment: Too bad, but the ugly variant will suffice. >>> import ssl >>> ctx = ssl.create_default_context() >>> ctx.options >>> ctx.verify_flags >>> ctx.verify_mode Latest patch: https://github.com/tiran/cpython/commits/feature/ssl_enum --

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Ethan Furman added the comment: Evidently the correct form is: super(SSLContext, SSLContext).options.__set__(self, value) Not sure that's any better. :( -- ___ Python tracker

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Ethan Furman added the comment: See issue14965. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Ethan Furman added the comment: A little more research shows this is a problem with inheriting descriptors. -- ___ Python tracker ___

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Ethan Furman added the comment: Huh. Well, for property this works: @property def options(self): return Options(_SSLContext.options.__get__(self)) @options.setter def options(self, value): _SSLContext.options.__set__(self, Options.OP_ALL) Sure is ugly, though.

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Christian Heimes
Christian Heimes added the comment: I tried: class SSLContext(_SSLContext): ... @property def options(self): return Options(super().options) @options.setter def options(self, value) super().options = value # ^ # This fails with

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Ethan Furman added the comment: Can you give me a code sample? Also, wouldn't be more readable? And keep the "OP_" names as aliases. -- ___ Python tracker ___ __

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Christian Heimes
Christian Heimes added the comment: Thanks Ethan! I have updated the patch with documentation and your fix. Do you have an easy recipe to wrap properties like SSLContext.options to return an enum? It's not easy because super() does not support attribute proxy assignment. super().verify_mode =

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue28025] Use IntEnum and IntFlags in ssl module

2016-09-08 Thread Christian Heimes
New submission from Christian Heimes: The patch removes ssl._import_symbols and adds more enums to the ssl module. Please review the patch. I'll update documentation in the next step. With IntFlags it is much easier to understand flags like SSLContext.options >>> import ssl >>> ctx = ssl.creat