Skip to content

None should be a subtype of an empty protocol #3906

Closed

Description

@ilevkivskyi

Currently this gives an incompatible type error with --strict-optional, although it works with plain object:

class Empty(Protocol):
    pass

e: Empty
e = None  # Error

o: object
o = None # This is OK

Activity

  1. self-assigned this
    on Sep 1, 2017
  2. gvanrossum commented on Sep 1, 2017

    @gvanrossum
    Member

    Should we have a topic-protocols label?

  3. JukkaL commented on Sep 1, 2017

    @JukkaL
    Collaborator

    Yes. Do you want to add one?

  4. gvanrossum commented on Sep 1, 2017

    @gvanrossum
    Member

    Created the label and added some issues. Ivan may want to double-check, there may be more issues to be categorized this way.

  5. ilevkivskyi commented on Sep 1, 2017

    @ilevkivskyi
    MemberAuthor

    Thanks! I added the label to few other issues.

  6. added a commit that references this issue on Sep 29, 2017
    b3ca169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions