Skip to content

Commit

Permalink
Add dictionary setitem example to Overview docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Oct 24, 2023
1 parent 583658c commit 4e820f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/source/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ object and use it to decorate functions.
return 2 * x
# Assigning as you would a dictionary also works
def baz(x):
return 3 * x
my_registry["baz"] = baz # The key could be any string.
# You can also register classes this way.
@my_registry
class Baz:
Expand Down

0 comments on commit 4e820f1

Please sign in to comment.