Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2ee377d
initial
JelleZijlstra Mar 6, 2022
831b565
Implementation, tests, and docs
JelleZijlstra Mar 7, 2022
f03f8a9
fix versionadded
JelleZijlstra Mar 7, 2022
404668a
Merge branch 'main' into funcregistry
JelleZijlstra Mar 8, 2022
7a5b0d1
make get_key_for_callable private
JelleZijlstra Mar 8, 2022
6998255
doc updates; remove unnecessary try-except
JelleZijlstra Mar 9, 2022
26bb908
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Mar 27, 2022
f52b757
rename method
JelleZijlstra Mar 27, 2022
fc6a925
Don't store singledispatch in the registry
JelleZijlstra Mar 27, 2022
b524244
more tests
JelleZijlstra Mar 27, 2022
e95558e
and another
JelleZijlstra Mar 27, 2022
31fd72d
fix line length in new tests
JelleZijlstra Mar 27, 2022
7041ad3
Update Doc/library/functools.rst
JelleZijlstra Mar 27, 2022
e26b0db
Update Doc/library/typing.rst
JelleZijlstra Mar 27, 2022
1bf89fb
only for overload
JelleZijlstra Apr 2, 2022
83ac432
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Apr 2, 2022
dfdbdc7
fix tests
JelleZijlstra Apr 2, 2022
e16c8d0
undo stray changes, fix NEWS entry
JelleZijlstra Apr 2, 2022
b3d2227
remove extra import
JelleZijlstra Apr 2, 2022
9727eee
Apply suggestions from code review
JelleZijlstra Apr 2, 2022
2e374b8
Apply suggestions from code review
JelleZijlstra Apr 3, 2022
ff03b12
Guido's feedback
JelleZijlstra Apr 3, 2022
17f0710
Optimizations suggested by Guido and Alex
JelleZijlstra Apr 3, 2022
2346970
inline _get_firstlineno, store outer objects for classmethod/staticme…
JelleZijlstra Apr 3, 2022
f2053a0
use defaultdict
JelleZijlstra Apr 3, 2022
b6131ad
another optimization
JelleZijlstra Apr 4, 2022
506bd66
Update Lib/typing.py
JelleZijlstra Apr 7, 2022
e9a2100
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Apr 8, 2022
2b1a5cc
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Apr 9, 2022
103bfd4
Simpler implementation (thanks Guido)
JelleZijlstra Apr 9, 2022
d453f7f
More comments and tests
JelleZijlstra Apr 9, 2022
450afeb
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Apr 14, 2022
ea62287
simplify clear_overloads
JelleZijlstra Apr 14, 2022
905253c
use partial
JelleZijlstra Apr 14, 2022
debbf8a
add test
JelleZijlstra Apr 14, 2022
754c134
docs changes (thanks Alex)
JelleZijlstra Apr 14, 2022
1ad8224
Merge remote-tracking branch 'upstream/main' into funcregistry
JelleZijlstra Apr 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs changes (thanks Alex)
  • Loading branch information
JelleZijlstra committed Apr 14, 2022
commit 754c134dbbedbabb35612212aec5309c1898fe7e
5 changes: 3 additions & 2 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2419,9 +2419,10 @@ Functions and decorators
overloaded function. For example, given the definition of ``process`` in
Comment on lines +2418 to +2419

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence sounds quite strange to me:

*func* is the function object for the implementation of the overloaded function.

But I'm not sure I have a better suggestion off the top of my head ://

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unfortunately the overload docs don't have a clear term for the implementation function either.

the documentation for :func:`@overload <overload>`,
``get_overloads(process)`` will return a sequence of three function objects
for the three defined overloads.
for the three defined overloads. If called on a function with no overloads,
``get_overloads`` returns an empty sequence.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``get_overloads`` returns an empty sequence.
return an empty sequence.

Tiny nit -- this paragraph starts off using the imperative mood

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the previous sentence is in the indicative, so I think this is fine?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's not really a big deal either way :)


This function can be used for introspecting an overloaded function at
``get_overloads`` can be used for introspecting an overloaded function at
runtime.
Comment thread
JelleZijlstra marked this conversation as resolved.

.. versionadded:: 3.11
Expand Down