473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Language Semantics: @ symbol??

Sorry, for the noob question, but I haven't been able to find
documentation on this matter.

I've been looking for documentation that describes what the @function()
syntax is all about.

I've seen this on a few pages, for instance:

http://aspn.activestate.com/ASPN/Coo.../Recipe/307871

and also in TurboGears:

http://www.turbogears.com/docs/wiki20/page5.html

The general format appears to be:

@somefunction()
def a_newfunction():
....

What does it mean and what does it do?

Thanks!

Jan 29 '06 #1
6 1122
"Enigma Curry" <wo*****@gmail.com> wrote:
Sorry, for the noob question, but I haven't been able to find
documentation on this matter.

I've been looking for documentation that describes what the @function()
syntax is all about.


http://www.google.com/search?q=python+decorators
Jan 29 '06 #2
Enigma Curry <wo*****@gmail.com> wrote:
...
@somefunction()
def a_newfunction():
....

What does it mean and what does it do?


It means and does exactly the same thing as having

a_newfunction = somefunction()(a_newfunction)

right after the end of a_newfunction's body.

<http://www.python.org/doc/current/whatsnew/node6.html>
Alex
Jan 30 '06 #3
Brennus wrote:
"Enigma Curry" <wo*****@gmail.com> wrote:

Sorry, for the noob question, but I haven't been able to find
documentation on this matter.

I've been looking for documentation that describes what the @function()
syntax is all about.

http://www.google.com/search?q=python+decorators


http://www.google.com/search?q=@
Jan 30 '06 #4
James Stroud wrote:
http://www.google.com/search?q=@


Doesn't work for me, I just get an (almost) empty
Google page. Doesn't even say "No results were found",
just a Google logo, some standard links in the footer,
text box, etc.

Even if Google did search for bare @ signs, surely the
first bazillion and a half hits would be email address?

--
Steven.

Jan 30 '06 #5
Steven D'Aprano wrote:
James Stroud wrote:
http://www.google.com/search?q=@


Doesn't work for me, I just get an (almost) empty
Google page. Doesn't even say "No results were found",
just a Google logo, some standard links in the footer,
text box, etc.


FWIW, same here. Also the same for all other punctuation which I tried
except "*" which produces a tiny bit of something related to news, and
"&" which does in fact work "as expected" (though I now have to reset my
expectations of what should work, as apparently James does).

-Peter

Jan 30 '06 #6
Peter Hansen wrote:
Steven D'Aprano wrote:
James Stroud wrote:
http://www.google.com/search?q=@

Doesn't work for me, I just get an (almost) empty Google page. Doesn't
even say "No results were found", just a Google logo, some standard
links in the footer, text box, etc.

FWIW, same here. Also the same for all other punctuation which I tried
except "*" which produces a tiny bit of something related to news, and
"&" which does in fact work "as expected" (though I now have to reset my
expectations of what should work, as apparently James does).

-Peter


Sorry, bad humor.

James
Jan 30 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave Opstad | last post by:
I fully understand why this happens: ---------------------------- >>> a = , , , , ] >>> b = ] * 5 >>> a , , , , ] >>> b , , , , ] >>> a == b
4
by: Andrew E | last post by:
Hi all I've written a python program that adds orders into our order routing simulation system. It works well, and has a syntax along these lines: ./neworder --instrument NOKIA --size 23...
24
by: Xah Lee | last post by:
What is Expresiveness in a Computer Language 20050207, Xah Lee. In languages human or computer, there's a notion of expressiveness. English for example, is very expressive in manifestation,...
22
by: Michael Nahas | last post by:
Antti & all interested, The draft description of my language to replace C is available at: http://nahas.is-a-geek.com/~mike/MyC.pdf I am a long time C programmer (I read the old testament...
4
by: Nitin Bhardwaj | last post by:
Hello all, I am puzzled by the term 'semantics' ! Well I know about 'syntax of a language' - as defined by its associated grammar Then what is this semantics? What does the C Compiler checks...
3
by: C# Learner | last post by:
Note ---- Please use a fixed-width font to view this, such as Courier New. Problem
23
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
56
by: Adem | last post by:
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" The C++ Standard (ISO/IEC 14882, Second edition, 2003-10-15) says under...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.