欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

马哥 今日小技巧 Python中的is和==的区别 有大用

Python中的is和==的区别,is时检查对象的标识符是否一致,也就是比较两个对象在内存中的地址是否一样,而==用来检查两个对象是否相等。例如在判断a is b时 相当于在判断id(a) == id(b),a == b 则是调用对象的__eq__方法,相当于a.__eq__(b)。

linux:

Nginx Method Limit

[xxx@xx conf]$ cat http_method_limit.conf

if ($request_method = PUT ) {

    return 403;

}


if ($request_method = TRACE ) {

    return 403;

}


if ($request_method = DELETE ) {

    return 403;

}


普通分类: