machinalis / mypy-data

mypy typesheds for the Python data stack
BSD 3-Clause "New" or "Revised" License
86 stars 23 forks source link

Overload functions with an out parameter #9

Open dmoisset opened 8 years ago

dmoisset commented 8 years ago

Some functions like:

    def all(self, axis: AxesType=None, out: '_ArrayLike[_U]'=None, keepdims: bool=False) -> Union['_ArrayLike[_U]', '_ArrayLike[bool]']: ...

Should actually be defined as:

    @overload
    def all(self, axis: AxesType=None, keepdims: bool=False) -> '_ArrayLike[_S]: ...
    @overload
    def all(self, axis: AxesType=None, keepdims: bool=False, out: '_ArrayLike[_U]') -> '_ArrayLike[_U]: ...

But that's not working correctly because of python/mypy#1907