mypy-zope icon indicating copy to clipboard operation
mypy-zope copied to clipboard

adaptation callable ought to return a union type with its second argument

Open glyph opened this issue 2 years ago • 0 comments

i.e.

from zope.interface import Interface

class IFoo(Interface):
    def foo() -> int:
        ...

reveal_type(IFoo(object(), None))
Revealed type is "IFoo"

This ought to be IFoo | None.

glyph avatar Sep 16 '22 00:09 glyph