Skip to content
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

Improve decorators documentation (add decorator factories) #8336

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Jan 26, 2020

As mentioned in #3157 (comment) I found the documentation for decorator usage to be lacking:

  • Previously only bare decorators were explained, but decorator
    factories are also fairly common in the real world.
  • Also added decorator examples to cheat sheet page.
  • Explained difference in behavior for class decorators.
  • Shortened (IMO) excessive example for bare decorators.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks! Documentation improvements are appreciated, and definition decorators is one of the trickier things users will regularly encounter.

docs/source/generics.rst Outdated Show resolved Hide resolved
docs/source/generics.rst Outdated Show resolved Hide resolved
docs/source/generics.rst Outdated Show resolved Hide resolved
docs/source/generics.rst Outdated Show resolved Hide resolved
docs/source/cheat_sheet.rst Outdated Show resolved Hide resolved
docs/source/cheat_sheet_py3.rst Outdated Show resolved Hide resolved
@intgr intgr force-pushed the expand-decorator-docs branch 6 times, most recently from 9381045 to 5519ea3 Compare January 30, 2020 22:43
* Previously only bare decorators were explained, but decorator
  factories are also fairly common in the real world.
* Added decorator examples to cheat sheet page.
* Explained difference in behavior for class decorators.
* Shortened (IMO) excessive example for bare decorators.
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks!

@JukkaL JukkaL merged commit 150d492 into python:master Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants