zoukankan      html  css  js  c++  java
  • PythonWrongNotes

    1.  

    def auth(func):
    def inDecoretor(*args,**kwargs):
    username = input("username:")
    password = input("password:")
    func(args,kwargs) //TypeError: home() takes 0 positional arguments but 2 were given
    return inDecoretor

    def auth(func):
    def inDecoretor(*args,**kwargs):
    username = input("username:")
    password = input("password:")
    func(*args,*kwargs)
    return inDecoretor

    2.

    def auth(): //TypeError: auth() takes 0 positional arguments but 1 was given
    def outDecoretor(func):
    def inDecoretor(*args, **kwargs):
    username = input("username:")
    password = input("password:")
    func(*args, **kwargs)
    return inDecoretor
    return outDecoretor

    @auth
    def home():
    print("this is home")



    def auth(autoType):
    def outDecoretor(func):
    def inDecoretor(*args, **kwargs):
    username = input("username:")
    password = input("password:")
    func(*args, **kwargs)
    return inDecoretor
    return outDecoretor

    @auth("parameter")
    def home():
    print("this is home")
     

     

    3.

    4.

    5.

    6.




     

  • 相关阅读:
    javascript 备忘 细节 相关
    内存泄漏
    css相关 细节 优化 备忘
    nodeType
    事件冒泡 模型
    两个感叹号作用
    非冒泡事件
    DOM 对象
    Quartz2D 之 绘制文本
    Voilin 与 乐谱
  • 原文地址:https://www.cnblogs.com/liujun5319/p/9612556.html
Copyright © 2011-2022 走看看