Skip to content

None should be a subtype of an empty protocol #3906

Closed
@ilevkivskyi

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions