Shoobx / mypy-zope

Plugin for mypy to support zope.interface
MIT License
38 stars 11 forks source link

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

Open glyph opened 1 year ago

glyph commented 1 year ago

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.