Skip to content

ssl.OP_NO_TLSv1_3 is available in 3.6.3+, mask as >= (3, 6)#5013

Merged
srittau merged 2 commits intopython:masterfrom
altendky:patch-1
Feb 10, 2021
Merged

ssl.OP_NO_TLSv1_3 is available in 3.6.3+, mask as >= (3, 6)#5013
srittau merged 2 commits intopython:masterfrom
altendky:patch-1

Conversation

@altendky
Copy link
Contributor

@altendky altendky commented Feb 9, 2021

No description provided.

@altendky
Copy link
Contributor Author

altendky commented Feb 9, 2021

https://docs.python.org/3.9/library/ssl.html#ssl.OP_NO_TLSv1_3

ssl.OP_NO_TLSv1_3 is available not only in >=3.7 but also in ~=3.6.3. I don't know what the typeshed policy is on handling of public changes that take place in patch releases. I figured submitting this PR would provide a concrete change to discuss.

The specific case where this came up is code in Trio which accesses ssl.OP_NO_TLSv1_3 and which I am trying to type check from 3.6 through 3.9. If I # type: ignore[attr-defined] then 3.6 is happy but the rest complain about an unused ignore (that setting isn't mandatory, but I do like it).

@altendky
Copy link
Contributor Author

altendky commented Feb 9, 2021

https://github.com/python/typeshed/blob/8f7e2216b66b9e8181b119fa2f7d560fca987605/CONTRIBUTING.md#stub-versioning

There's the answer. Seems like the change here is correct then.

@altendky altendky mentioned this pull request Feb 9, 2021
11 tasks
stdlib/ssl.pyi Outdated
OP_NO_TICKET: int
if sys.version_info >= (3, 7):
OP_NO_RENEGOTIATION: int
if sys.version_info >= (3, 6):
Copy link
Contributor

@freundTech freundTech Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a sys.version_info >= (3, 6) guard around the class, so you could probably just remove this guard and move the line to line 141, where it would fit better.

Same for the other change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite so, thank you.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@srittau
Copy link
Collaborator

srittau commented Feb 10, 2021

If you mark this as "ready for review", I can merge it.

@altendky
Copy link
Contributor Author

@srittau, sorry. No changelog needed here?

@altendky altendky marked this pull request as ready for review February 10, 2021 13:24
@srittau srittau merged commit 27f38b8 into python:master Feb 10, 2021
@srittau
Copy link
Collaborator

srittau commented Feb 10, 2021

No, typeshed doesn't have a Changelog beyond git log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants