装饰器的原理就是利用《闭包函数》来实现,闭包函数的原理就是包含内层函数的return和外层环境变量:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhAAAAGECAIAAADofY4WAAAgAElEQVR4nO2dTWsby7qo9Qs819iD7IkHa+LZopoLxoNlE8c4/gpEhMjBIdjxBbFGEYmhJ7ZJyGBDFAeCMehmkmE0OZc1cNDM/g0b9C/OGekMqru6+qNa1XK1pJafB3GOVqtVVS3v1NP1VnW9tWGtxosXL168eI181Ya12v+xxgMAgAcJwgAAACsQBgAAWIEwAADACoQBAABWIAwAALACYQAAgBUIAwAArEAYAABgBcIAAAArEAYAAFiBMAAAwAr3wjh5V7vt1E+EGHmmeF6/+1qTr6vno8/PLkQ0u4PhcNj3LWocG7FzeHFz+nZHpA5+/Pb707ffny78dZfVHR1e/PzYPirxigAAijI1YYjHi71O7fbdkmVD/X62FSYgDCmGy85+vN799k1Zfbos/NvvTzgDAGYHK2EUKtFWGM/rhQYWJmGUjRDrb39+vPx5uCHSw4tWozxLif32zcfLMqsAACiEG2EIsXx2XlPxJV0YJ+8yDnpFhCFHEDEG3aYQXmARSeSSZncw7PflJ/2u/PKg2ww+zfyK3x8OB92mqqnvR+08al2mglFeljCkWtSYQBy1pGbC48GgIVGaOGrJoFY6riU/Sh4U8gqm4E4AeOA4EIa0hfKBPsJQ7/Vz9KmLwCXni3ujur+cEUbio2Z3oHX/fV80u4PhoNvUz0wEsvz+cDgcDAZ9X/vAMwwvNvxT1cXLlxwH5AtDeWLDP1XRLZONwh82o3aEAQDTwoUwntfvvtZ6x8vyPyNJxGcp9o4X9CGFw5BUhjAG3abs+UMFqANq9KCLQfXBnufJDlkKJogLxWcvgvYXHmEkj3ue1+h8zJ8t3/BPiUoBwIzgQBgJEySEkRhMTF8YcTRhZM6o77dvsvv0+wsjcTwThAEAs4OzEYZJGGrkkf+tkbgShhw6WBZe6ghDHmeEAQBVwYUwtNCTHG2k5y0yvlVQGGFvfw9hmBfgmoWRvUTKM6ySan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12AcC8gTDmge3t7R8/fshRhf4eAMAhCAMAAKyYmjCE2Fvs3dZ6Z04eY77npDQJfAAARlIZYSxd3S6c7WUXlZXgqGBjSOADADCCyoSkTMJw9WAdCXwAAPJxspfU3mLvtn5yUr+9rd3d1W57i3vhxqVnvYWzveWzXu3urnZ3p3p8daR2dTKynOhk9dK/ZUhwNEZCJxL4AADk4EwYtbu7+knYv4eBpqCv750tCyH2zhY0lwSfpoQR84T2aeYIwzS8GC+hU4V2AQEAmDwORxhqs9KTut7ph/LQj0syhRGVc3Klz3AYhDF6+/FCCZ0qvR0TAECplC8MTQkJXAkjHUQaO6ETwgAAMFGCMPbOFm6vlsTkhJEYYdwnoRPCAAAw4V4YS1e3SgMOhaFHt7SvZMw6jJ3QiTkMAIAcXE56p5cwZQojeX74lXxhxL4VXyWVfn5ivIROJPABAMjB/Qhjwrh7DoMEPgAAeVReGJ6LBEck8AEAGMk8CMNzsJcUCXwAAEZQma1ByoMERAAANiAMEhABAFiBMDyPBEQAABYgDAAAsAJhAACAFQgDAACsQBgAAGAFwgAAACsQBgAAWIEwAADACoQBAABWIAwAALACYQAAgBUIAwAArEAYAABgBcIAAAArEAYAAFiBMAAAwAqEAQAAViAMAACwAmEAAIAVgTB48eLFixevka//BToHVYrYfMyeAAAAAElFTkSuQmCC" alt="" />

装饰器: 装饰器本质上是一个Python函数,其他函数在不需要做任何代码变动的前提下增加额外功能,装饰器的返回值(return)也是一个函数对象。它经常用于有切面需求的场景,比如:插入日志、性能测试、事务处理、缓存、权限校验等场景。

1
2
3
4
5
6
7
8
9
先来看一个简单例子:
 
def foo():
    print('i am foo')
现在有一个新的需求,希望可以记录下函数的执行日志,于是在代码中添加日志代码:
 
def foo():
    print('i am foo')
    logging.info("foo is running")

bar()、bar2()也有类似的需求,怎么做?再写一个logging在bar函数里?这样就造成大量雷同的代码,为了减少重复写代码,我们可以这样做,重新定义一个函数:专门处理日志 ,日志处理完之后再执行真正的业务代码

1
2
3
4
5
6
7
8
def use_logging(func):
    logging.warn("%s is running" % func.__name__)
    func()
 
def bar():
    print('i am bar')
 
use_logging(bar)

逻 辑上不难理解, 但是这样的话,我们每次都要将一个函数作为参数传递给use_logging函数。而且这种方式已经破坏了原有的代码逻辑结构,之前执行业务逻辑时,执行 运行bar(),但是现在不得不改成use_logging(bar)。那么有没有更好的方式的呢?当然有,答案就是装饰器。

简单装饰器

 
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwkAAAETCAIAAADyK90PAAAgAElEQVR4nO3de1RU570//md1uRLypd9A0qVngIOay6LoT8h4TCy6cprh27pCfkkQV86pJO1JqKkprfme4Pf86iGnJzImQRhLIPpF0doj0TadHjVFDAq5IohCRBm5iUURq6mIYCbiDBtmIp/fH89mz2ZuzP3CvF/rWVkz2733PDNDZt7z7OfCKDQxhoKCgoKCgoIS+MKCHYIcYOzrr78+e/ZssOsBAAAAkSR8s9HRoz3Xr48EskYAAAAw84VvNnriiZ1Hj/YEoCJlZQ0tLZed7MAm+eThXnzxRZ+cBwAAADwRvtkoMPR6I2Pq0tIG57sZjcbQfSUBAADAdaH7je40G5WWNpSWTmnOKS1t+P3vT+/b19rUdGnHjiZBMEm7VVd3/va3zT091+VnOHbs4nvvnRocvG11wuPH+/bubf3qKyPf/uqrf2ZMvXLlXudNRxTKryQAAAC4LnS/0Z1mI8bUVs05fItU6urOW2389rffunpVz3feu7eVb1y06F2jcVzac968LYypExM11dWdVqedtunI6pXs6Oh45JFHUlNTOzo6+Jbu7m6lUhkfH//666+/8sordrdYXZvjdzdv3rx06VIn5wEAAACfCdNsRES22WjTpo+l//J/mpiYYEz9v/93VW/vDcbU+/a18p1TUt596aU/tbf/jTH1wYPt0hlSU7f29t5w/kCO6zPllVyxYsXHH3/8ySefrFixgm9JS0trbW1tb29fsmSJoy0mk0l+HrPZzBirq6u7dOnSrFmzHB0FAAAAPjOTslFpaYP8v/Lto6PjjKl37jzJN95/f2FR0adjYybG1L/9bbPdE1qd+coVfUfHNaf1nfJKxsT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nDVDAAALJCNHBIE8Zs1I8PO16rdEhtLKpWlZGRQQYF10WotuYoXXL/z3sAA1ddTRQUVFJBKRcnJ9t8gpdLSwwwAAMAuZCM36HTiNbiCAsrJsWQg2+tx3pSoqCkBS6Wi3Nwp6aqszDpdRYL+fvHJ8tc/P198cfjSe45yKn/p6uuppyfYTwAAAMIEspHvWQUX3pghL9L3up/SFb/85yRd2Q1YvASmcxW/2iUvVVXWNczIIJXKzsVNuyU5mVQqKiigigqqr8c1MgAA8ByyUYjibVROooNV+pGPPJ95RWpLy84Wn77U5QsAAMC3kI1mJtuGmdpaO52fsrKsM5a8+DXlyAvv4S4vlZVitdECBAAAAYZsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGCBbAQAAABggWwEAAAAYIFsBAAAAGARytkIBQUFBQUFBSXw5f8HW5YDz5KqUHMAAAAASUVORK5CYII=" alt="" />

函 数use_logging就是装饰器,它把执行真正业务方法的func包裹在函数里面,看起来像bar被use_logging装饰了。在这个例子中,函 数进入和退出时 ,被称为一个横切面(Aspect),这种编程方式被称为面向切面的编程(Aspect-Oriented Programming)。

@符号是装饰器的语法糖,在定义函数的时候使用,避免再一次赋值操作

aa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UuUWEhDJwO2lvqp4PyRFqJ4nFDbAEdm5j1I6M7gETMPhATYjCSh46v4FF1ZMhuUPtJIkZAwtg414n6pRceANMYMpUI9JVFkotTPYEbCvUTpKVO2AF7IAPn5Taleg3wBNgsEonaTsLRTX3fHxsNdROkjN3wAJ4Bo6+QKmjpltx8w6rnSshedDzqSZDm62H2kmKZQAYwBOwCVDTP+AIvAArwGAeL2kUnjLRVM3uQO0kZdMHDGAZbJt+AUfABOa8E5Fa4qkLbbcnooe2U1A7SfU4tulWl39k5/c7bl4GTUmFTICtux/RitlAneSinexBRmrFDTAHTOBNCSM54xc4As/AEjCqnirpAp7eCbZ7dlr1rEiFXLSTPchInekBBrCSoOmfT00/ZZkp18aQvOgDU+AF+HRnui1oaBL6bElDGQITwAxeG/MpQdMVPb0kNj1gAjz7LqoPYMmriChQO0lLUNfGfOrU1DYa9pKFZDCnlwCGctl8+x6/XoA5JZPooHaS1nIDGIAJvOjujKqg2haqCUyoqa3DzkQzgClgikweAy4GOyttwZXHJApqJ+kWhmQh7QJCp+pt9AhsJIxqsGZvPbiRz8IAVvLQY8oHag9/fpl2fLCEJEkLtZMQ3MkiGRN4i9JUe3zLbfpNuX2bEl7lCBpT99ulHXtFBY/xPo7Ij8nzGMRnIJIRaichgaiaukto03AUMT4ULXxR5HahyPOwqsuFdIkzqJ2EpGIQaksdOZTxFsPcnAeYqgw/kxpC7SSEEEKSQe0khBBCkkHtJIQQQpJB7SSEEEKSQe0khBBCkkHtJIQQQpJx0U72ICOEEEJictFO9iAjhBBCYkKfLSGEEJIMaichhBCSDGonIYQQkgxqJyGEEJIMaichhBCSDGonIYQQkgxqJyGEEJIMaichhBCSDGonIYQQkgxqJyGEEJIMaichhBCSDGonIYQQkgxqJyGEEJIM9iAjhBBCksEeZIQQQkgy6LMlhBBCkkHtJIQQQpJB7SSEEEKSQe0khBBCknHRTg4ODg4ODo744/8Ddv4LWW6U0tgAAAAASUVORK5CYII=" alt="" />

如 上所示,这样我们就可以省去bar = use_logging(bar)这一句了,直接调用bar()即可得到想要的结果。如果我们有其他的类似函数,我们可以继续调用装饰器来修饰函数,而不 用重复修改函数或者增加新的封装。这样,我们就提高了程序的可重复利用性,并增加了程序的可读性。

装饰器在Python使用如此方便都要归因于Python的函数能像普通的对象一样能作为参数传递给其他函数,可以被赋值给其他变量,可以作为返回值,可以被定义在另外一个函数内。

带参数的装饰器

装饰器还有更大的灵活性,例如带参数的装饰器:在上面的装饰器调用中,比如 @use_logging,该装饰器唯一的参数就是执行业务的函数。装饰器的语法允许我们在调用时,提供其它参数,比如@decorator(a)。这 样,就为装饰器的编写和使用提供了更大的灵活性。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def use_logging(level):
    def decorator(func):
        def wrapper(*args, **kwargs):
            if level == "warn":
                logging.warn("%s is running" % func.__name__)
            return func(*args)
        return wrapper
 
    return decorator
 
@use_logging(level="warn")
def foo(name='foo'):
    print("i am %s" % name)
 
foo()

上 面的use_logging是允许带参数的装饰器。它实际上是对原有装饰器的一个函数封装,并返回一个装饰器。我们可以将它理解为一个含有参数的闭包。当 我 们使用@use_logging(level="warn")调用的时候,Python能够发现这一层的封装,并把参数传递到装饰器的环境中。

类装饰器

再来看看类装饰器,相比函数装饰器,类装饰器具有灵活度大、高内聚、封装性等优点。使用类装饰器还可以依靠类内部的__call__方法,当使用 @ 形式将装饰器附加到函数上时,就会调用此方法。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Foo(object):
    def __init__(self, func):
      self._func = func
 
    def __call__(self):
      print ('class decorator runing')
      self._func()
      print ('class decorator ending')
 
@Foo
def bar():
    print ('bar')
 
bar()
functools.wraps

使用装饰器极大地复用了代码,但是他有一个缺点就是原函数的元信息不见了,比如函数的docstring、__name__、参数列表,先看例子:

装饰器

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
def logged(func):
    def with_logging(*args, **kwargs):
        print func.__name__ + " was called"
        return func(*args, **kwargs)
    return with_logging
函数
 
@logged
def f(x):
   """does some math"""
   return + * x
该函数完成等价于:
 
 
def f(x):
    """does some math"""
    return + * x
= logged(f)
不难发现,函数f被with_logging取代了,当然它的docstring,__name__就是变成了with_logging函数的信息了。
 
print f.__name__    # prints 'with_logging'
print f.__doc__     # prints None

  

这个问题就比较严重的,好在我们有functools.wraps,wraps本身也是一个装饰器,它能把原函数的元信息拷贝到装饰器函数中,这使得装饰器函数也有和原函数一样的元信息了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from functools import wraps
def logged(func):
    @wraps(func)
    def with_logging(*args, **kwargs):
        print func.__name__ + " was called"
        return func(*args, **kwargs)
    return with_logging
 
@logged
def f(x):
    """does some math"""
    return + * x
 
print f.__name__  # prints 'f'
print f.__doc__   # prints 'does some math'

  

内置装饰器

@staticmathod、@classmethod、@property

装饰器的顺序

@a
@b
@c
def f ():

等效于
  f = a(b(c(f)))

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVoAAACSCAIAAACL/5VMAAAOLUlEQVR4nO2dMY/cNhbH+QmCfIO4TJnOUeHARRK43CKp0rgi3MVfIJHuCyhwo5TGJYAHCAQYNhC580KVi22cSgvFhnE47y2gZo3NXdZYeM0r+CSRlCiJGs2MNP7/IGBHGpHD0fL9+fjIIZlgDAcOHDgEY0ww9ubNm+fPnwsAwIcM5AAAQEAOAAAE5AAAQEAOAAAE5AAAQEAOAAAE5AAAQEAOwP5QpFGc7boQNUUap8WuC+EE5GBfydKFVcV1yWI/mvgrr/0Ms3jqIm0WFznIQ48RXpgP/4z82GOPeLJOMfcQteloaUayOAiCUU1dkUb+2LQTMb7wIynSyG9+3gye4cL0YLAcJFwVgYSbipAcWQ0ectBCkaZVXcviRr3LYn+Nti6LW4xjYjpazvUKP6Io7TY3h2dYpNGS9GCgHOShJ80/4dI94EnCVQvPw6cweAdUBZjcrd+CGsyn1duQwU31DLehzNMxTA4SznhS/024F+Z5yGv/4ISj/R9GkUZBg2kb0zVrYGsJNc+5SKOttv4dbKr1ncy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/>

python装饰器的原理的更多相关文章

  1. 【低门槛 手把手】python 装饰器(Decorators)原理说明

    本文目的是由浅入深地介绍python装饰器原理 装饰器(Decorators)是 Python 的一个重要部分 其功能是,在不修改原函数(类)定义代码的情况下,增加新的功能 为了理解和实现装饰器,我们 ...

  2. Python装饰器详解

    python中的装饰器是一个用得非常多的东西,我们可以把一些特定的方法.通用的方法写成一个个装饰器,这就为调用这些方法提供一个非常大的便利,如此提高我们代码的可读性以及简洁性,以及可扩展性. 在学习p ...

  3. 粗浅聊聊Python装饰器

    浅析装饰器 通常情况下,给一个对象添加新功能有三种方式: 直接给对象所属的类添加方法: 使用组合:(在新类中创建原有类的对象,重复利用已有类的功能) 使用继承:(可以使用现有类的,无需重复编写原有类进 ...

  4. python 装饰器、递归原理、模块导入方式

    1.装饰器原理 def f1(arg): print '验证' arg() def func(): print ' #.将被调用函数封装到另外一个函数 func = f1(func) #.对原函数重新 ...

  5. 【转】【python】装饰器的原理

    写在前面: 在开发OpenStack过程中,经常可以看到代码中的各种注解,自己也去查阅了资料,了解了这是python中的装饰器,因为弱类型的语言可以将函数当成返回值返回,这就是装饰器的原理. 虽然说知 ...

  6. 关于python装饰器

    关于python装饰器,不是系统的介绍,只是说一下某些问题 1 首先了解变量作用于非常重要 2 其次要了解闭包 def logger(func): def inner(*args, **kwargs) ...

  7. Python装饰器由浅入深

    装饰器的功能在很多语言中都有,名字也不尽相同,其实它体现的是一种设计模式,强调的是开放封闭原则,更多的用于后期功能升级而不是编写新的代码.装饰器不光能装饰函数,也能装饰其他的对象,比如类,但通常,我们 ...

  8. Python装饰器模式学习总结

    装饰器模式,重点在于装饰.装饰的核心仍旧是被装饰对象. 类比于Java编程的时候的包装模式,是同样的道理.虽然概念上稍有不同但是原理上还是比较相近的.下面我就来谈一谈我对Python的装饰器的学习的一 ...

  9. Python 装饰器(Decorator)

    装饰器的语法为 @dec_name ,置于函数定义之前.如: import atexit @atexit.register def goodbye(): print('Goodbye!') print ...

随机推荐

  1. c++顺序表(数组)查找最大最小值

    #include <iostream> #define MAXSIZE 100 using namespace std; void find(int a[],int m) {int min ...

  2. intellij idea http proxy config

    # custom IntelliJ IDEA properties #http proxy -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.prox ...

  3. 关于mysql创建数据库,基字符集 和 数据库排序规则 的对比选择

    1.一般选择utf8.下面介绍一下utf8与utfmb4的区别. utf8mb4兼容utf8,且比utf8能表示更多的字符.至于什么时候用,看你的做什么项目了,unicode编码区从1 - 126就属 ...

  4. 11.二进制中1的个数 Java

    题目描述 输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示. 思路 当n不等于0时执行以下循环: 1.判断n的最低位是否为1,若为1,则计数器加1 2.将n无符号右移1位(若使用带符号移 ...

  5. LeetCode 106. 从中序与后序遍历序列构造二叉树(Construct Binary Tree from Inorder and Postorder Traversal)

    题目描述 根据一棵树的中序遍历与后序遍历构造二叉树. 注意:你可以假设树中没有重复的元素. 例如,给出 中序遍历 inorder = [9,3,15,20,7] 后序遍历 postorder = [9 ...

  6. CentOS 安装 Mongodb详解 --- 无Linux基础

    先去官方下载离线安装包:https://www.mongodb.com/ ftp连接一下服务器,把离线包上传上去 XShell连接一下: 解压文件(你输一点就可以按tab键,它会自动补全):tar - ...

  7. leetcode-hard-array-454 4sum II-NO

    mycode   过不了...我也不知道为什么... class Solution(object): def fourSumCount(self, A, B, C, D): ""& ...

  8. 代码实现:定义一个文件输入流,调用read(byte[] b)方法,将a.txt文件中的内容打印出来(byte数组大小限制为5)

    package com.loaderman.test; import java.io.ByteArrayOutputStream; import java.io.FileInputStream; im ...

  9. Service-stack.redis 使用PooledRedisClientManager 速度慢的原因之一

    现在越来越多的开发者使用service-stack.redis 来进行redis的访问,但是获取redisclient的方式有多种方式,其中有一种从缓冲池获取client的方式很是得到大家的认可. L ...

  10. C++的学习笔记1

    一:      为了惯例具有指针成员的类,必须定义三个复制控制成员:复制构造函数.赋值操作符和析构函数.  复制构造函数分配新元素并从被复制对象处复制值,赋值操作符撤销所保存的原对象并从右操作数向左操 ...