镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

User-defined protocols #3838

Closed
Closed

Description

@JukkaL

This issue tracks the remaining things needed for making user-defined protocols work.

Now that #3132 was merged, mypy understand protocols. However, we still need runtime support for protocols (the Protocol class) and Protocol needs to be added to typeshed before protocols can actually be used in user code.

See also #3132 (comment).

Switching ABCs in typing to be protocols is a separate issue and requires coordination with other users of typeshed.

Activity

  1. JukkaL commented on Aug 16, 2017

    @JukkaL
    CollaboratorAuthor
  2. ilevkivskyi commented on Aug 19, 2017

    @ilevkivskyi
    Member

    OK, here is a PR with runtime implementation in typing_extensions python/typing#464 and a PR with the corresponding stubs python/typeshed#1564

  3. JukkaL commented on Nov 22, 2017

    @JukkaL
    CollaboratorAuthor

    This has been supported for a while now.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions