A little bit of Python's understanding of adorners

Source: Internet
Author: User

More and more, for some terms, really can not see the name of the idea to use their own language/ideas to try to explain, such as socket/sockets, and then such as adorners, only by literal meaning, difficult to understand, but will take you to the pit

def F1 (FN):     def action ():         return " <a> "+fn () +"</a>"    return  action@f1  def  Test ():    return"istest"print Test ()

Run results

<a> is test</a>

In an example

defF1 (FN):defaction ():return "<a>"+FN () +"</a>"    returnActiondefTest ():return "is test"PrintF1 (Test) ()#Attention!!! The adorner is gone, and the output of the end is changed.

In this way, the adorner is so much more understandable.

# actually @f1 def Test ():     Pass # here is equivalent to:test=f1 (Test)

A little bit of Python's understanding of adorners

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.