[issue45100] Teach help about typing.overload()

2021-09-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: > The two @overload definitions will be overwritten by > the non-overload one at runtime, and hence will ever > been seen by help(). We can fix this by adding an __overloads__ attribute. The overload decorator can accumulate the chain in an external

[issue45100] Teach help about typing.overload()

2021-09-05 Thread Diego Ramirez
Change by Diego Ramirez : -- nosy: +DiddiLeija ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45100] Teach help about typing.overload()

2021-09-05 Thread Alex Waygood
Alex Waygood added the comment: There is a similar issue with `functools.singledispatch` ``` >>> from functools import singledispatch >>> @singledispatch ... def flip(x: str) -> int: ... """Signature when given a string""" ... return int(x) ... >>> @flip.register ... def _(x: int) ->

[issue45100] Teach help about typing.overload()

2021-09-05 Thread Ken Jin
Change by Ken Jin : -- nosy: +gvanrossum, kj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45100] Teach help about typing.overload()

2021-09-05 Thread Ronald Oussoren
Ronald Oussoren added the comment: I agree that this would be nice to have, but wonder how help() could access that information. The two @overload definitions will be overwritten by the non-overload one at runtime, and hence will ever been seen by help(). -- nosy: +ronaldoussoren

[issue45100] Teach help about typing.overload()

2021-09-04 Thread Raymond Hettinger
New submission from Raymond Hettinger : Python's help() function does not display overloaded function signatures. For example, this code: from typing import Union class Smudge(str): @overload def __getitem__(self, index: int) -> str: ...