Skip to content

Docs for function overloading are made more complex by using __getitem__ as example #4579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gvanrossum opened this issue Feb 16, 2018 · 0 comments · Fixed by #5229
Closed

Comments

@gvanrossum
Copy link
Member

I've got a feeling that the docs for overloading could be made easier on the eyes and easier to grasp for first-time readers if they didn't use __getitem__ as the main example. Overloading is quite useful for non-dunder methods and functions!

Michael0x2a added a commit to Michael0x2a/mypy that referenced this issue Jun 17, 2018
This pull request:

1.  Moves documentation about overloads into the "More types" section.

    (Rationale: although overloads aren't really a type, I feel it
    makes sense for them to live somewhere in the "Type System
    Reference" section instead of the "Miscellaneous" section.)

2.  Modifies the docs to start with a non-dunder example (resolves
    python#4579) and simplifies the
    `__dunder__` example.

3.  Adds some documentation about the "pick the first match" rule.

4.  Removes the now out-of-date note about erasure.
This was referenced Jun 17, 2018
Michael0x2a added a commit that referenced this issue Jul 3, 2018
This pull request overhauls the overloads documentation to reflect the
new change in semantics. Specific changes made:

1.  Moves documentation about overloads into the "Type System
    Reference" section -- specifically, in the "More types" page.

2.  Modifies the docs to start with a non-dunder example (resolves
    #4579) and simplifies the
    `__dunder__` example.

3.  Adds documentation about specific checks mypy will perform: in
    particular, the "no-shadowing" and "no unsafe variant" definition
    checks.
    
4.  Documents the new "pick the first match" rule.

5.  Removes the now out-of-date note about erasure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants