Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Nancy Melucci
Courses Plus Student 34,558 Points"@" sign in Python decorators.
I am afraid to ask this. Might be silly. I've never seen @ signs in Python before. I am familiar with them from Java. Is there any relationship between the use of @ in Java annotations and its use in Python for decorators?
2 Answers

Chris Howell
Python Web Development Techdegree Graduate 49,610 PointsActually that is not a silly question.
I think the best simple explanation I found of this was on this Stack Overflow Link
Python decorators are just syntactic sugar for passing a function to another function and replacing the first function with the result
Java annotations by themselves just store metadata, you must have something that inspects them to add behaviour.

Nancy Melucci
Courses Plus Student 34,558 PointsSo there is no relationship between function and symbol...just a different use of the same code. Thanks.

Chris Howell
Python Web Development Techdegree Graduate 49,610 PointsYes, it appears they are written alike, but are used differently. :)