Skip to content

Commit

Permalink
Docs: Add missing class instantiation to cheat sheet (python#16817)
Browse files Browse the repository at this point in the history
  • Loading branch information
atarv authored Jan 25, 2024
1 parent ec06e00 commit 3838bff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/cheat_sheet_py3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Classes
# This will allow access to any A.x, if x is compatible with the return type
def __getattr__(self, name: str) -> int: ...
a = A()
a.foo = 42 # Works
a.bar = 'Ex-parrot' # Fails type checking
Expand Down

0 comments on commit 3838bff

Please sign in to comment.